From 9e5ace5ae32c0e257663a6fef2de69396b14b4e5 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Wed, 16 Feb 2022 12:05:15 -0500
Subject: [PATCH 01/14] [monoapi] Split type and function headers, add
 MONO_API_FUNCTION macro

The idea is that the function header can be included multiple times with
different definitions of MONO_API_FUNCTION in order to make it easier to
re-used the definitions for embedding the runtime in late-binding scenarios
---
 .../utils/details/mono-counters-functions.h   |  45 +++++
 .../mono/utils/details/mono-counters-types.h  |  73 +++++++
 .../details/mono-dl-fallback-functions.h      |  13 ++
 .../utils/details/mono-dl-fallback-types.h    |  36 ++++
 .../mono/utils/details/mono-error-functions.h |  20 ++
 .../mono/utils/details/mono-error-types.h     |  82 ++++++++
 .../utils/details/mono-logger-functions.h     |  19 ++
 .../mono/utils/details/mono-logger-types.h    |  16 ++
 .../utils/details/mono-publib-functions.h     |  11 ++
 .../mono/utils/details/mono-publib-types.h    | 180 ++++++++++++++++++
 src/native/public/mono/utils/mono-counters.h  |  98 +---------
 .../public/mono/utils/mono-dl-fallback.h      |  32 +---
 src/native/public/mono/utils/mono-error.h     |  95 +--------
 src/native/public/mono/utils/mono-logger.h    |  20 +-
 src/native/public/mono/utils/mono-publib.h    | 177 +----------------
 src/native/public/monoapi.cmake               |  13 +-
 16 files changed, 529 insertions(+), 401 deletions(-)
 create mode 100644 src/native/public/mono/utils/details/mono-counters-functions.h
 create mode 100644 src/native/public/mono/utils/details/mono-counters-types.h
 create mode 100644 src/native/public/mono/utils/details/mono-dl-fallback-functions.h
 create mode 100644 src/native/public/mono/utils/details/mono-dl-fallback-types.h
 create mode 100644 src/native/public/mono/utils/details/mono-error-functions.h
 create mode 100644 src/native/public/mono/utils/details/mono-error-types.h
 create mode 100644 src/native/public/mono/utils/details/mono-logger-functions.h
 create mode 100644 src/native/public/mono/utils/details/mono-logger-types.h
 create mode 100644 src/native/public/mono/utils/details/mono-publib-functions.h
 create mode 100644 src/native/public/mono/utils/details/mono-publib-types.h

diff --git a/src/native/public/mono/utils/details/mono-counters-functions.h b/src/native/public/mono/utils/details/mono-counters-functions.h
new file mode 100644
index 00000000000000..b5073edb16f97f
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-counters-functions.h
@@ -0,0 +1,45 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_counters_enable, (int section_mask))
+MONO_API_FUNCTION(MONO_API void, mono_counters_init, (void))
+
+/*
+ * register addr as the address of a counter of type type.
+ * It may be a function pointer if MONO_COUNTER_CALLBACK is specified:
+ * the function should return the value and take no arguments.
+ */
+MONO_API_FUNCTION(MONO_API void, mono_counters_register, (const char* descr, int type, void *addr))
+MONO_API_FUNCTION(MONO_API void, mono_counters_register_with_size, (const char *name, int type, void *addr, int size))
+
+MONO_API_FUNCTION(MONO_API void, mono_counters_on_register, (MonoCounterRegisterCallback callback))
+
+/*
+ * Create a readable dump of the counters for section_mask sections (ORed section values)
+ */
+MONO_API_FUNCTION(MONO_API void, mono_counters_dump, (int section_mask, FILE *outfile))
+
+MONO_API_FUNCTION(MONO_API void, mono_counters_cleanup, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_counters_foreach, (CountersEnumCallback cb, void *user_data))
+
+MONO_API_FUNCTION(MONO_API int, mono_counters_sample, (MonoCounter *counter, void *buffer, int buffer_size))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_counter_get_name, (MonoCounter *name))
+MONO_API_FUNCTION(MONO_API int, mono_counter_get_type, (MonoCounter *counter))
+MONO_API_FUNCTION(MONO_API int, mono_counter_get_section, (MonoCounter *counter))
+MONO_API_FUNCTION(MONO_API int, mono_counter_get_unit, (MonoCounter *counter))
+MONO_API_FUNCTION(MONO_API int, mono_counter_get_variance, (MonoCounter *counter))
+MONO_API_FUNCTION(MONO_API size_t, mono_counter_get_size, (MonoCounter *counter))
+
+MONO_API_FUNCTION(MONO_API int,  mono_runtime_resource_limit, (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit))
+MONO_API_FUNCTION(MONO_API void, mono_runtime_resource_set_callback, (MonoResourceCallback callback))
+MONO_API_FUNCTION(MONO_API void, mono_runtime_resource_check_limit,  (int resource_type, uintptr_t value))
+
+
+
diff --git a/src/native/public/mono/utils/details/mono-counters-types.h b/src/native/public/mono/utils/details/mono-counters-types.h
new file mode 100644
index 00000000000000..196cef645e3635
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-counters-types.h
@@ -0,0 +1,73 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_COUNTERS_TYPES_H
+#define _MONO_COUNTERS_TYPES_H
+
+#include <stdio.h>
+#include <mono/utils/details/mono-publib-types.h>
+
+MONO_BEGIN_DECLS
+
+enum {
+	/* Counter type, bits 0-7. */
+	MONO_COUNTER_INT,    /* 32 bit int */
+	MONO_COUNTER_UINT,    /* 32 bit uint */
+	MONO_COUNTER_WORD,   /* pointer-sized int */
+	MONO_COUNTER_LONG,   /* 64 bit int */
+	MONO_COUNTER_ULONG,   /* 64 bit uint */
+	MONO_COUNTER_DOUBLE,
+	MONO_COUNTER_STRING, /* char* */
+	MONO_COUNTER_TIME_INTERVAL, /* 64 bits signed int holding usecs. */
+	MONO_COUNTER_TYPE_MASK = 0xf,
+	MONO_COUNTER_CALLBACK = 128, /* ORed with the other values */
+	MONO_COUNTER_SECTION_MASK = 0x00ffff00,
+	/* Sections, bits 8-23 (16 bits) */
+	MONO_COUNTER_JIT      = 1 << 8,
+	MONO_COUNTER_GC       = 1 << 9,
+	MONO_COUNTER_METADATA = 1 << 10,
+	MONO_COUNTER_GENERICS = 1 << 11,
+	MONO_COUNTER_SECURITY = 1 << 12,
+	MONO_COUNTER_RUNTIME  = 1 << 13,
+	MONO_COUNTER_SYSTEM   = 1 << 14,
+	MONO_COUNTER_PERFCOUNTERS = 1 << 15,
+	MONO_COUNTER_PROFILER = 1 << 16,
+	MONO_COUNTER_INTERP   = 1 << 17,
+	MONO_COUNTER_TIERED   = 1 << 18,
+	MONO_COUNTER_LAST_SECTION,
+
+	/* Unit, bits 24-27 (4 bits) */
+	MONO_COUNTER_UNIT_SHIFT = 24,
+	MONO_COUNTER_UNIT_MASK = 0xFu << MONO_COUNTER_UNIT_SHIFT,
+	MONO_COUNTER_RAW        = 0 << 24,  /* Raw value */
+	MONO_COUNTER_BYTES      = 1 << 24, /* Quantity of bytes. RSS, active heap, etc */
+	MONO_COUNTER_TIME       = 2 << 24,  /* Time interval in 100ns units. Minor pause, JIT compilation*/
+	MONO_COUNTER_COUNT      = 3 << 24, /*  Number of things (threads, queued jobs) or Number of events triggered (Major collections, Compiled methods).*/
+	MONO_COUNTER_PERCENTAGE = 4 << 24, /* [0-1] Fraction Percentage of something. Load average. */
+
+	/* Monotonicity, bits 28-31 (4 bits) */
+	MONO_COUNTER_VARIANCE_SHIFT = 28,
+	MONO_COUNTER_VARIANCE_MASK = 0xFu << MONO_COUNTER_VARIANCE_SHIFT,
+	MONO_COUNTER_MONOTONIC      = 1 << 28, /* This counter value always increase/decreases over time. Reported by --stat. */
+	MONO_COUNTER_CONSTANT       = 1 << 29, /* Fixed value. Used by configuration data. */
+	MONO_COUNTER_VARIABLE       = 1 << 30, /* This counter value can be anything on each sampling. Only interesting when sampling. */
+};
+
+typedef struct _MonoCounter MonoCounter;
+
+typedef void (*MonoCounterRegisterCallback) (MonoCounter*);
+
+typedef mono_bool (*CountersEnumCallback) (MonoCounter *counter, void *user_data);
+
+typedef enum {
+	MONO_RESOURCE_JIT_CODE, /* bytes */
+	MONO_RESOURCE_METADATA, /* bytes */
+	MONO_RESOURCE_GC_HEAP,  /* bytes */
+	MONO_RESOURCE_COUNT /* non-ABI value */
+} MonoResourceType;
+
+typedef void (*MonoResourceCallback) (int resource_type, uintptr_t value, int is_soft);
+
+MONO_END_DECLS
+
+#endif /* _MONO_COUNTERS_TYPES_H */
diff --git a/src/native/public/mono/utils/details/mono-dl-fallback-functions.h b/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
new file mode 100644
index 00000000000000..84cd5696a4ffdc
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
@@ -0,0 +1,13 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MonoDlFallbackHandler *, mono_dl_fallback_register, (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func, \
+										MonoDlFallbackClose close_func, void *user_data))
+MONO_API_FUNCTION(MONO_API void, mono_dl_fallback_unregister, (MonoDlFallbackHandler *handler))
+
+
diff --git a/src/native/public/mono/utils/details/mono-dl-fallback-types.h b/src/native/public/mono/utils/details/mono-dl-fallback-types.h
new file mode 100644
index 00000000000000..b4f5db8cfcad90
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-dl-fallback-types.h
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_DL_FALLBACK_TYPES_H
+#define _MONO_DL_FALLBACK_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+
+MONO_BEGIN_DECLS
+
+enum {
+	MONO_DL_EAGER  = 0,
+	MONO_DL_LAZY   = 1,
+	// If MONO_DL_LOCAL is set, it will trump MONO_DL_GLOBAL.
+	MONO_DL_LOCAL  = 2,
+	// MONO_DL_MASK is unused internally and no longer a full mask on netcore, given the introduction of MONO_DL_GLOBAL. Avoid.
+	MONO_DL_MASK   = 3,
+	// Only applicable when building Mono in netcore mode.
+	MONO_DL_GLOBAL = 4
+};
+
+/*
+ * This is the dynamic loader fallback API
+ */
+typedef struct MonoDlFallbackHandler MonoDlFallbackHandler;
+
+/*
+ * The "err" variable contents must be allocated using g_malloc or g_strdup
+ */
+typedef void* (*MonoDlFallbackLoad) (const char *name, int flags, char **err, void *user_data);
+typedef void* (*MonoDlFallbackSymbol) (void *handle, const char *name, char **err, void *user_data);
+typedef void* (*MonoDlFallbackClose) (void *handle, void *user_data);
+
+MONO_END_DECLS
+
+#endif
diff --git a/src/native/public/mono/utils/details/mono-error-functions.h b/src/native/public/mono/utils/details/mono-error-functions.h
new file mode 100644
index 00000000000000..f7a4b505982bf2
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-error-functions.h
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_error_init, (MonoError *error))
+MONO_API_FUNCTION(MONO_API void, mono_error_init_flags, (MonoError *error, unsigned short flags))
+
+MONO_API_FUNCTION(MONO_API void, mono_error_cleanup, (MonoError *error))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_error_ok, (MonoError *error))
+
+MONO_API_FUNCTION(MONO_API unsigned short, mono_error_get_error_code, (MonoError *error))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_error_get_message, (MonoError *error))
+
+
diff --git a/src/native/public/mono/utils/details/mono-error-types.h b/src/native/public/mono/utils/details/mono-error-types.h
new file mode 100644
index 00000000000000..97c69f29f07d38
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-error-types.h
@@ -0,0 +1,82 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_ERROR_TYPES_H
+#define _MONO_ERROR_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+
+enum {
+	/*
+	The supplied strings were dup'd by means of calling mono_error_dup_strings.
+	*/
+	MONO_ERROR_FREE_STRINGS = 0x0001,
+
+	/*
+	Something happened while processing the error and the resulting message is incomplete.
+	*/
+	MONO_ERROR_INCOMPLETE = 0x0002,
+	/*
+	This MonoError is heap allocated in a mempool
+        */
+	MONO_ERROR_MEMPOOL_BOXED = 0x0004
+};
+
+enum {
+	MONO_ERROR_NONE = 0,
+	MONO_ERROR_MISSING_METHOD = 1,
+	MONO_ERROR_MISSING_FIELD = 2,
+	MONO_ERROR_TYPE_LOAD = 3,
+	MONO_ERROR_FILE_NOT_FOUND = 4,
+	MONO_ERROR_BAD_IMAGE = 5,
+	MONO_ERROR_OUT_OF_MEMORY = 6,
+	MONO_ERROR_ARGUMENT = 7,
+	MONO_ERROR_ARGUMENT_NULL = 11,
+	MONO_ERROR_ARGUMENT_OUT_OF_RANGE = 14,
+	MONO_ERROR_NOT_VERIFIABLE = 8,
+	MONO_ERROR_INVALID_PROGRAM = 12,
+	MONO_ERROR_MEMBER_ACCESS = 13,
+
+	/*
+	 * This is a generic error mechanism is you need to raise an arbitrary corlib exception.
+	 * You must pass the exception name otherwise prepare_exception will fail with internal execution.
+	 */
+	MONO_ERROR_GENERIC = 9,
+	/* This one encapsulates a managed exception instance */
+	MONO_ERROR_EXCEPTION_INSTANCE = 10,
+
+	/* Not a valid error code - indicates that the error was cleaned up and reused */
+	MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff
+};
+
+#ifdef _MSC_VER
+__pragma(warning (push))
+__pragma(warning (disable:4201))
+#endif
+
+/*Keep in sync with MonoErrorInternal*/
+typedef union _MonoError {
+	// Merge two uint16 into one uint32 so it can be initialized
+	// with one instruction instead of two.
+	uint32_t init;
+	struct {
+		uint16_t error_code;
+		uint16_t private_flags; /*DON'T TOUCH */
+		void *hidden_1 [12]; /*DON'T TOUCH */
+	};
+} MonoErrorExternal;
+
+#ifdef _MSC_VER
+__pragma(warning (pop))
+#endif
+
+#ifdef MONO_INSIDE_RUNTIME
+typedef union _MonoErrorInternal MonoError;
+#else
+typedef MonoErrorExternal MonoError;
+#endif
+
+/* Mempool-allocated MonoError.*/
+typedef struct _MonoErrorBoxed MonoErrorBoxed;
+
+#endif
diff --git a/src/native/public/mono/utils/details/mono-logger-functions.h b/src/native/public/mono/utils/details/mono-logger-functions.h
new file mode 100644
index 00000000000000..63a57c05197138
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-logger-functions.h
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_trace_set_level_string, (const char *value))
+
+MONO_API_FUNCTION(MONO_API void, mono_trace_set_mask_string, (const char *value))
+
+MONO_API_FUNCTION(MONO_API void, mono_trace_set_log_handler, (MonoLogCallback callback, void *user_data))
+
+MONO_API_FUNCTION(MONO_API void, mono_trace_set_print_handler, (MonoPrintCallback callback))
+
+MONO_API_FUNCTION(MONO_API void, mono_trace_set_printerr_handler, (MonoPrintCallback callback))
+
+
diff --git a/src/native/public/mono/utils/details/mono-logger-types.h b/src/native/public/mono/utils/details/mono-logger-types.h
new file mode 100644
index 00000000000000..8b90088c4781d8
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-logger-types.h
@@ -0,0 +1,16 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_LOGGER_TYPES_H
+#define _MONO_LOGGER_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef void (*MonoPrintCallback) (const char *string, mono_bool is_stdout);
+typedef void (*MonoLogCallback) (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data);
+
+MONO_END_DECLS
+
+#endif /* _MONO_LOGGER_TYPES_H */
diff --git a/src/native/public/mono/utils/details/mono-publib-functions.h b/src/native/public/mono/utils/details/mono-publib-functions.h
new file mode 100644
index 00000000000000..71d4ba836598c9
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-publib-functions.h
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_free, (void*))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_set_allocator_vtable, (MonoAllocatorVTable* vtable))
+
diff --git a/src/native/public/mono/utils/details/mono-publib-types.h b/src/native/public/mono/utils/details/mono-publib-types.h
new file mode 100644
index 00000000000000..551cf0aa152f53
--- /dev/null
+++ b/src/native/public/mono/utils/details/mono-publib-types.h
@@ -0,0 +1,180 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_PUBLIB_TYPES_H
+#define _MONO_PUBLIB_TYPES_H
+
+/*
+ * Minimal general purpose header for use in public mono header files.
+ * We can't include config.h, so we use compiler-specific preprocessor
+ * directives where needed.
+ */
+
+#ifdef  __cplusplus
+#define MONO_BEGIN_DECLS  extern "C" {
+#define MONO_END_DECLS    }
+#else
+#define MONO_BEGIN_DECLS /* nothing */
+#define MONO_END_DECLS   /* nothing */
+#endif
+
+MONO_BEGIN_DECLS
+
+/* VS 2010 and later have stdint.h */
+#if defined(_MSC_VER)
+
+#if _MSC_VER < 1600
+
+typedef __int8			int8_t;
+typedef unsigned __int8		uint8_t;
+typedef __int16			int16_t;
+typedef unsigned __int16	uint16_t;
+typedef __int32			int32_t;
+typedef unsigned __int32	uint32_t;
+typedef __int64			int64_t;
+typedef unsigned __int64	uint64_t;
+
+#else
+
+#include <stdint.h>
+
+#endif
+
+#define MONO_API_EXPORT __declspec(dllexport)
+#define MONO_API_IMPORT __declspec(dllimport)
+
+#else
+
+#include <stdint.h>
+
+#if defined (__clang__) || defined (__GNUC__)
+#define MONO_API_EXPORT __attribute__ ((__visibility__ ("default")))
+#else
+#define MONO_API_EXPORT
+#endif
+#define MONO_API_IMPORT
+
+#endif /* end of compiler-specific stuff */
+
+#include <stdlib.h>
+
+#ifdef __cplusplus
+#define MONO_EXTERN_C extern "C"
+#else
+#define MONO_EXTERN_C /* nothing */
+#endif
+
+#if defined(MONO_DLL_EXPORT)
+	#define MONO_API_NO_EXTERN_C MONO_API_EXPORT
+#elif defined(MONO_DLL_IMPORT)
+	#define MONO_API_NO_EXTERN_C MONO_API_IMPORT
+#else
+	#define MONO_API_NO_EXTERN_C /* nothing  */
+#endif
+
+#define MONO_API MONO_EXTERN_C MONO_API_NO_EXTERN_C
+
+// Should (but not must) wrap in extern "C" (MONO_BEGIN_DECLS, MONO_END_DECLS).
+#define MONO_API_DATA MONO_API_NO_EXTERN_C extern
+
+typedef int32_t		mono_bool;
+typedef uint8_t		mono_byte;
+typedef mono_byte       MonoBoolean;
+#ifdef _WIN32
+MONO_END_DECLS
+#include <wchar.h>
+typedef wchar_t 	mono_unichar2;
+MONO_BEGIN_DECLS
+#else
+typedef uint16_t	mono_unichar2;
+#endif
+typedef uint32_t	mono_unichar4;
+
+typedef void	(*MonoFunc)	(void* data, void* user_data);
+typedef void	(*MonoHFunc)	(void* key, void* value, void* user_data);
+
+#define MONO_ALLOCATOR_VTABLE_VERSION 1
+
+typedef struct {
+	int version;
+	void *(*malloc)      (size_t size);
+	void *(*realloc)     (void *mem, size_t count);
+	void (*free)        (void *mem);
+	void *(*calloc)      (size_t count, size_t size);
+} MonoAllocatorVTable;
+
+#define MONO_CONST_RETURN const
+
+/*
+ * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
+ * other Mono header file if you use a different compiler from the one used to
+ * build Mono.
+ */
+#ifndef MONO_ZERO_LEN_ARRAY
+#ifdef __GNUC__
+#define MONO_ZERO_LEN_ARRAY 0
+#else
+#define MONO_ZERO_LEN_ARRAY 1
+#endif
+#endif
+
+#if defined (MONO_INSIDE_RUNTIME)
+
+#if defined (__CENTRINEL__)
+/* Centrinel is an analyzer that warns about raw pointer to managed objects
+ * inside Mono.
+ */
+#define MONO_RT_MANAGED_ATTR __CENTRINEL_MANAGED_ATTR
+#define MONO_RT_CENTRINEL_SUPPRESS __CENTRINEL_SUPPRESS_ATTR(1)
+#else
+#define MONO_RT_MANAGED_ATTR
+#define MONO_RT_CENTRINEL_SUPPRESS
+#endif
+
+#if defined (__clang__) || defined (__GNUC__)
+// attribute(deprecated(message)) was introduced in gcc 4.5.
+// attribute(deprecated))         was introduced in gcc 4.0.
+// Compare: https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Function-Attributes.html
+//          https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Function-Attributes.html
+//          https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html
+#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
+#define MONO_RT_EXTERNAL_ONLY \
+	__attribute__ ((__deprecated__ ("The mono runtime must not call this function."))) \
+	MONO_RT_CENTRINEL_SUPPRESS
+#elif __GNUC__ >= 4
+#define MONO_RT_EXTERNAL_ONLY __attribute__ ((__deprecated__)) MONO_RT_CENTRINEL_SUPPRESS
+#else
+#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS
+#endif
+
+#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
+// Pragmas for controlling diagnostics appear to be from gcc 4.2.
+// This is used in place of configure gcc -Werror=deprecated-declarations:
+// 1. To be portable across build systems.
+// 2. configure is very sensitive to compiler flags; they break autoconf's probes.
+// Though #2 can be mitigated by being late in configure.
+#pragma GCC diagnostic error "-Wdeprecated-declarations"
+#endif
+
+#else
+#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS
+#endif // clang or gcc
+
+#else
+#define MONO_RT_EXTERNAL_ONLY
+#define MONO_RT_MANAGED_ATTR
+#endif /* MONO_INSIDE_RUNTIME */
+
+#if defined (__clang__) || defined (__GNUC__)
+#define _MONO_DEPRECATED __attribute__ ((__deprecated__))
+#elif defined (_MSC_VER)
+#define _MONO_DEPRECATED __declspec (deprecated)
+#else
+#define _MONO_DEPRECATED
+#endif
+
+#define MONO_DEPRECATED MONO_API MONO_RT_EXTERNAL_ONLY _MONO_DEPRECATED
+
+MONO_END_DECLS
+
+#endif /* _MONO_PUBLIB_TYPES_H */
diff --git a/src/native/public/mono/utils/mono-counters.h b/src/native/public/mono/utils/mono-counters.h
index c5da782c7faacc..fe3f1008ae578e 100644
--- a/src/native/public/mono/utils/mono-counters.h
+++ b/src/native/public/mono/utils/mono-counters.h
@@ -5,101 +5,15 @@
 #ifndef __MONO_COUNTERS_H__
 #define __MONO_COUNTERS_H__
 
-#include <stdio.h>
-#include <mono/utils/mono-publib.h>
+#include <mono/utils/details/mono-counters-types.h>
 
-enum {
-	/* Counter type, bits 0-7. */
-	MONO_COUNTER_INT,    /* 32 bit int */
-	MONO_COUNTER_UINT,    /* 32 bit uint */
-	MONO_COUNTER_WORD,   /* pointer-sized int */
-	MONO_COUNTER_LONG,   /* 64 bit int */
-	MONO_COUNTER_ULONG,   /* 64 bit uint */
-	MONO_COUNTER_DOUBLE,
-	MONO_COUNTER_STRING, /* char* */
-	MONO_COUNTER_TIME_INTERVAL, /* 64 bits signed int holding usecs. */
-	MONO_COUNTER_TYPE_MASK = 0xf,
-	MONO_COUNTER_CALLBACK = 128, /* ORed with the other values */
-	MONO_COUNTER_SECTION_MASK = 0x00ffff00,
-	/* Sections, bits 8-23 (16 bits) */
-	MONO_COUNTER_JIT      = 1 << 8,
-	MONO_COUNTER_GC       = 1 << 9,
-	MONO_COUNTER_METADATA = 1 << 10,
-	MONO_COUNTER_GENERICS = 1 << 11,
-	MONO_COUNTER_SECURITY = 1 << 12,
-	MONO_COUNTER_RUNTIME  = 1 << 13,
-	MONO_COUNTER_SYSTEM   = 1 << 14,
-	MONO_COUNTER_PERFCOUNTERS = 1 << 15,
-	MONO_COUNTER_PROFILER = 1 << 16,
-	MONO_COUNTER_INTERP   = 1 << 17,
-	MONO_COUNTER_TIERED   = 1 << 18,
-	MONO_COUNTER_LAST_SECTION,
+MONO_BEGIN_DECLS
 
-	/* Unit, bits 24-27 (4 bits) */
-	MONO_COUNTER_UNIT_SHIFT = 24,
-	MONO_COUNTER_UNIT_MASK = 0xFu << MONO_COUNTER_UNIT_SHIFT,
-	MONO_COUNTER_RAW        = 0 << 24,  /* Raw value */
-	MONO_COUNTER_BYTES      = 1 << 24, /* Quantity of bytes. RSS, active heap, etc */
-	MONO_COUNTER_TIME       = 2 << 24,  /* Time interval in 100ns units. Minor pause, JIT compilation*/
-	MONO_COUNTER_COUNT      = 3 << 24, /*  Number of things (threads, queued jobs) or Number of events triggered (Major collections, Compiled methods).*/
-	MONO_COUNTER_PERCENTAGE = 4 << 24, /* [0-1] Fraction Percentage of something. Load average. */
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/utils/details/mono-counters-functions.h>
+#undef MONO_API_FUNCTION
 
-	/* Monotonicity, bits 28-31 (4 bits) */
-	MONO_COUNTER_VARIANCE_SHIFT = 28,
-	MONO_COUNTER_VARIANCE_MASK = 0xFu << MONO_COUNTER_VARIANCE_SHIFT,
-	MONO_COUNTER_MONOTONIC      = 1 << 28, /* This counter value always increase/decreases over time. Reported by --stat. */
-	MONO_COUNTER_CONSTANT       = 1 << 29, /* Fixed value. Used by configuration data. */
-	MONO_COUNTER_VARIABLE       = 1 << 30, /* This counter value can be anything on each sampling. Only interesting when sampling. */
-};
-
-typedef struct _MonoCounter MonoCounter;
-
-MONO_API void mono_counters_enable (int section_mask);
-MONO_API void mono_counters_init (void);
-
-/*
- * register addr as the address of a counter of type type.
- * It may be a function pointer if MONO_COUNTER_CALLBACK is specified:
- * the function should return the value and take no arguments.
- */
-MONO_API void mono_counters_register (const char* descr, int type, void *addr);
-MONO_API void mono_counters_register_with_size (const char *name, int type, void *addr, int size);
-
-typedef void (*MonoCounterRegisterCallback) (MonoCounter*);
-MONO_API void mono_counters_on_register (MonoCounterRegisterCallback callback);
-
-/*
- * Create a readable dump of the counters for section_mask sections (ORed section values)
- */
-MONO_API void mono_counters_dump (int section_mask, FILE *outfile);
-
-MONO_API void mono_counters_cleanup (void);
-
-typedef mono_bool (*CountersEnumCallback) (MonoCounter *counter, void *user_data);
-
-MONO_API void mono_counters_foreach (CountersEnumCallback cb, void *user_data);
-
-MONO_API int mono_counters_sample (MonoCounter *counter, void *buffer, int buffer_size);
-
-MONO_API const char* mono_counter_get_name (MonoCounter *name);
-MONO_API int mono_counter_get_type (MonoCounter *counter);
-MONO_API int mono_counter_get_section (MonoCounter *counter);
-MONO_API int mono_counter_get_unit (MonoCounter *counter);
-MONO_API int mono_counter_get_variance (MonoCounter *counter);
-MONO_API size_t mono_counter_get_size (MonoCounter *counter);
-
-typedef enum {
-	MONO_RESOURCE_JIT_CODE, /* bytes */
-	MONO_RESOURCE_METADATA, /* bytes */
-	MONO_RESOURCE_GC_HEAP,  /* bytes */
-	MONO_RESOURCE_COUNT /* non-ABI value */
-} MonoResourceType;
-
-typedef void (*MonoResourceCallback) (int resource_type, uintptr_t value, int is_soft);
-
-MONO_API int  mono_runtime_resource_limit        (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit);
-MONO_API void mono_runtime_resource_set_callback (MonoResourceCallback callback);
-MONO_API void mono_runtime_resource_check_limit  (int resource_type, uintptr_t value);
+MONO_END_DECLS
 
 #endif /* __MONO_COUNTERS_H__ */
 
diff --git a/src/native/public/mono/utils/mono-dl-fallback.h b/src/native/public/mono/utils/mono-dl-fallback.h
index 11ec4f30b8ac07..b7919e5962eecd 100644
--- a/src/native/public/mono/utils/mono-dl-fallback.h
+++ b/src/native/public/mono/utils/mono-dl-fallback.h
@@ -5,37 +5,13 @@
 #ifndef __MONO_UTILS_DL_FALLBACK_H__
 #define __MONO_UTILS_DL_FALLBACK_H__
 
-#include <mono/utils/mono-publib.h>
+#include <mono/utils/details/mono-dl-fallback-types.h>
 
 MONO_BEGIN_DECLS
 
-enum {
-	MONO_DL_EAGER  = 0,
-	MONO_DL_LAZY   = 1,
-	// If MONO_DL_LOCAL is set, it will trump MONO_DL_GLOBAL.
-	MONO_DL_LOCAL  = 2,
-	// MONO_DL_MASK is unused internally and no longer a full mask on netcore, given the introduction of MONO_DL_GLOBAL. Avoid.
-	MONO_DL_MASK   = 3,
-	// Only applicable when building Mono in netcore mode.
-	MONO_DL_GLOBAL = 4
-};
-
-/*
- * This is the dynamic loader fallback API
- */
-typedef struct MonoDlFallbackHandler MonoDlFallbackHandler;
-
-/*
- * The "err" variable contents must be allocated using g_malloc or g_strdup
- */
-typedef void* (*MonoDlFallbackLoad) (const char *name, int flags, char **err, void *user_data);
-typedef void* (*MonoDlFallbackSymbol) (void *handle, const char *name, char **err, void *user_data);
-typedef void* (*MonoDlFallbackClose) (void *handle, void *user_data);
-
-MONO_API MonoDlFallbackHandler *mono_dl_fallback_register (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func,
-						  MonoDlFallbackClose close_func, void *user_data);
-
-MONO_API void                   mono_dl_fallback_unregister (MonoDlFallbackHandler *handler);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/utils/details/mono-dl-fallback-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/utils/mono-error.h b/src/native/public/mono/utils/mono-error.h
index 297412b3d5a151..4c3badfe2131f7 100644
--- a/src/native/public/mono/utils/mono-error.h
+++ b/src/native/public/mono/utils/mono-error.h
@@ -5,100 +5,13 @@
 #ifndef __MONO_ERROR_H__
 #define __MONO_ERROR_H__
 
-#include <mono/utils/mono-publib.h>
-
-enum {
-	/*
-	The supplied strings were dup'd by means of calling mono_error_dup_strings.
-	*/
-	MONO_ERROR_FREE_STRINGS = 0x0001,
-
-	/*
-	Something happened while processing the error and the resulting message is incomplete.
-	*/
-	MONO_ERROR_INCOMPLETE = 0x0002,
-	/*
-	This MonoError is heap allocated in a mempool
-        */
-	MONO_ERROR_MEMPOOL_BOXED = 0x0004
-};
-
-enum {
-	MONO_ERROR_NONE = 0,
-	MONO_ERROR_MISSING_METHOD = 1,
-	MONO_ERROR_MISSING_FIELD = 2,
-	MONO_ERROR_TYPE_LOAD = 3,
-	MONO_ERROR_FILE_NOT_FOUND = 4,
-	MONO_ERROR_BAD_IMAGE = 5,
-	MONO_ERROR_OUT_OF_MEMORY = 6,
-	MONO_ERROR_ARGUMENT = 7,
-	MONO_ERROR_ARGUMENT_NULL = 11,
-	MONO_ERROR_ARGUMENT_OUT_OF_RANGE = 14,
-	MONO_ERROR_NOT_VERIFIABLE = 8,
-	MONO_ERROR_INVALID_PROGRAM = 12,
-	MONO_ERROR_MEMBER_ACCESS = 13,
-
-	/*
-	 * This is a generic error mechanism is you need to raise an arbitrary corlib exception.
-	 * You must pass the exception name otherwise prepare_exception will fail with internal execution.
-	 */
-	MONO_ERROR_GENERIC = 9,
-	/* This one encapsulates a managed exception instance */
-	MONO_ERROR_EXCEPTION_INSTANCE = 10,
-
-	/* Not a valid error code - indicates that the error was cleaned up and reused */
-	MONO_ERROR_CLEANUP_CALLED_SENTINEL = 0xffff
-};
-
-#ifdef _MSC_VER
-__pragma(warning (push))
-__pragma(warning (disable:4201))
-#endif
-
-/*Keep in sync with MonoErrorInternal*/
-typedef union _MonoError {
-	// Merge two uint16 into one uint32 so it can be initialized
-	// with one instruction instead of two.
-	uint32_t init;
-	struct {
-		uint16_t error_code;
-		uint16_t private_flags; /*DON'T TOUCH */
-		void *hidden_1 [12]; /*DON'T TOUCH */
-	};
-} MonoErrorExternal;
-
-#ifdef _MSC_VER
-__pragma(warning (pop))
-#endif
-
-#ifdef MONO_INSIDE_RUNTIME
-typedef union _MonoErrorInternal MonoError;
-#else
-typedef MonoErrorExternal MonoError;
-#endif
-
-/* Mempool-allocated MonoError.*/
-typedef struct _MonoErrorBoxed MonoErrorBoxed;
+#include <mono/utils/details/mono-error-types.h>
 
 MONO_BEGIN_DECLS
 
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_error_init (MonoError *error);
-
-MONO_API void
-mono_error_init_flags (MonoError *error, unsigned short flags);
-
-MONO_API void
-mono_error_cleanup (MonoError *error);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_error_ok (MonoError *error);
-
-MONO_API unsigned short
-mono_error_get_error_code (MonoError *error);
-
-MONO_API const char*
-mono_error_get_message (MonoError *error);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/utils/details/mono-error-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/utils/mono-logger.h b/src/native/public/mono/utils/mono-logger.h
index e3ef20475485c3..4b063d76b5aa17 100644
--- a/src/native/public/mono/utils/mono-logger.h
+++ b/src/native/public/mono/utils/mono-logger.h
@@ -8,23 +8,11 @@
 #include <mono/utils/mono-publib.h>
 MONO_BEGIN_DECLS
 
-MONO_API void
-mono_trace_set_level_string (const char *value);
+#include <mono/utils/details/mono-logger-types.h>
 
-MONO_API void
-mono_trace_set_mask_string (const char *value);
-
-typedef void (*MonoPrintCallback) (const char *string, mono_bool is_stdout);
-typedef void (*MonoLogCallback) (const char *log_domain, const char *log_level, const char *message, mono_bool fatal, void *user_data);
-
-MONO_API void
-mono_trace_set_log_handler (MonoLogCallback callback, void *user_data);
-
-MONO_API void
-mono_trace_set_print_handler (MonoPrintCallback callback);
-
-MONO_API void
-mono_trace_set_printerr_handler (MonoPrintCallback callback);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/utils/details/mono-logger-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/utils/mono-publib.h b/src/native/public/mono/utils/mono-publib.h
index 24346ccf1c578c..e70a7dcac38db1 100644
--- a/src/native/public/mono/utils/mono-publib.h
+++ b/src/native/public/mono/utils/mono-publib.h
@@ -5,182 +5,13 @@
 #ifndef __MONO_PUBLIB_H__
 #define __MONO_PUBLIB_H__
 
-/*
- * Minimal general purpose header for use in public mono header files.
- * We can't include config.h, so we use compiler-specific preprocessor
- * directives where needed.
- */
-
-#ifdef  __cplusplus
-#define MONO_BEGIN_DECLS  extern "C" {
-#define MONO_END_DECLS    }
-#else
-#define MONO_BEGIN_DECLS /* nothing */
-#define MONO_END_DECLS   /* nothing */
-#endif
-
-MONO_BEGIN_DECLS
-
-/* VS 2010 and later have stdint.h */
-#if defined(_MSC_VER)
-
-#if _MSC_VER < 1600
-
-typedef __int8			int8_t;
-typedef unsigned __int8		uint8_t;
-typedef __int16			int16_t;
-typedef unsigned __int16	uint16_t;
-typedef __int32			int32_t;
-typedef unsigned __int32	uint32_t;
-typedef __int64			int64_t;
-typedef unsigned __int64	uint64_t;
-
-#else
-
-#include <stdint.h>
-
-#endif
-
-#define MONO_API_EXPORT __declspec(dllexport)
-#define MONO_API_IMPORT __declspec(dllimport)
-
-#else
-
-#include <stdint.h>
-
-#if defined (__clang__) || defined (__GNUC__)
-#define MONO_API_EXPORT __attribute__ ((__visibility__ ("default")))
-#else
-#define MONO_API_EXPORT
-#endif
-#define MONO_API_IMPORT
-
-#endif /* end of compiler-specific stuff */
-
-#include <stdlib.h>
-
-#ifdef __cplusplus
-#define MONO_EXTERN_C extern "C"
-#else
-#define MONO_EXTERN_C /* nothing */
-#endif
-
-#if defined(MONO_DLL_EXPORT)
-	#define MONO_API_NO_EXTERN_C MONO_API_EXPORT
-#elif defined(MONO_DLL_IMPORT)
-	#define MONO_API_NO_EXTERN_C MONO_API_IMPORT
-#else
-	#define MONO_API_NO_EXTERN_C /* nothing  */
-#endif
-
-#define MONO_API MONO_EXTERN_C MONO_API_NO_EXTERN_C
+#include <mono/utils/details/mono-publib-types.h>
 
-// Should (but not must) wrap in extern "C" (MONO_BEGIN_DECLS, MONO_END_DECLS).
-#define MONO_API_DATA MONO_API_NO_EXTERN_C extern
-
-typedef int32_t		mono_bool;
-typedef uint8_t		mono_byte;
-typedef mono_byte       MonoBoolean;
-#ifdef _WIN32
-MONO_END_DECLS
-#include <wchar.h>
-typedef wchar_t 	mono_unichar2;
 MONO_BEGIN_DECLS
-#else
-typedef uint16_t	mono_unichar2;
-#endif
-typedef uint32_t	mono_unichar4;
-
-typedef void	(*MonoFunc)	(void* data, void* user_data);
-typedef void	(*MonoHFunc)	(void* key, void* value, void* user_data);
-
-MONO_API void mono_free (void *);
-
-#define MONO_ALLOCATOR_VTABLE_VERSION 1
-
-typedef struct {
-	int version;
-	void *(*malloc)      (size_t size);
-	void *(*realloc)     (void *mem, size_t count);
-	void (*free)        (void *mem);
-	void *(*calloc)      (size_t count, size_t size);
-} MonoAllocatorVTable;
-
-MONO_API mono_bool
-mono_set_allocator_vtable (MonoAllocatorVTable* vtable);
-
-
-#define MONO_CONST_RETURN const
-
-/*
- * When embedding, you have to define MONO_ZERO_LEN_ARRAY before including any
- * other Mono header file if you use a different compiler from the one used to
- * build Mono.
- */
-#ifndef MONO_ZERO_LEN_ARRAY
-#ifdef __GNUC__
-#define MONO_ZERO_LEN_ARRAY 0
-#else
-#define MONO_ZERO_LEN_ARRAY 1
-#endif
-#endif
-
-#if defined (MONO_INSIDE_RUNTIME)
-
-#if defined (__CENTRINEL__)
-/* Centrinel is an analyzer that warns about raw pointer to managed objects
- * inside Mono.
- */
-#define MONO_RT_MANAGED_ATTR __CENTRINEL_MANAGED_ATTR
-#define MONO_RT_CENTRINEL_SUPPRESS __CENTRINEL_SUPPRESS_ATTR(1)
-#else
-#define MONO_RT_MANAGED_ATTR
-#define MONO_RT_CENTRINEL_SUPPRESS
-#endif
-
-#if defined (__clang__) || defined (__GNUC__)
-// attribute(deprecated(message)) was introduced in gcc 4.5.
-// attribute(deprecated))         was introduced in gcc 4.0.
-// Compare: https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Function-Attributes.html
-//          https://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Function-Attributes.html
-//          https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Function-Attributes.html
-#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-#define MONO_RT_EXTERNAL_ONLY \
-	__attribute__ ((__deprecated__ ("The mono runtime must not call this function."))) \
-	MONO_RT_CENTRINEL_SUPPRESS
-#elif __GNUC__ >= 4
-#define MONO_RT_EXTERNAL_ONLY __attribute__ ((__deprecated__)) MONO_RT_CENTRINEL_SUPPRESS
-#else
-#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS
-#endif
-
-#if defined (__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)
-// Pragmas for controlling diagnostics appear to be from gcc 4.2.
-// This is used in place of configure gcc -Werror=deprecated-declarations:
-// 1. To be portable across build systems.
-// 2. configure is very sensitive to compiler flags; they break autoconf's probes.
-// Though #2 can be mitigated by being late in configure.
-#pragma GCC diagnostic error "-Wdeprecated-declarations"
-#endif
-
-#else
-#define MONO_RT_EXTERNAL_ONLY MONO_RT_CENTRINEL_SUPPRESS
-#endif // clang or gcc
-
-#else
-#define MONO_RT_EXTERNAL_ONLY
-#define MONO_RT_MANAGED_ATTR
-#endif /* MONO_INSIDE_RUNTIME */
-
-#if defined (__clang__) || defined (__GNUC__)
-#define _MONO_DEPRECATED __attribute__ ((__deprecated__))
-#elif defined (_MSC_VER)
-#define _MONO_DEPRECATED __declspec (deprecated)
-#else
-#define _MONO_DEPRECATED
-#endif
 
-#define MONO_DEPRECATED MONO_API MONO_RT_EXTERNAL_ONLY _MONO_DEPRECATED
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/utils/details/mono-publib-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake
index 6a03dda903477e..44d88ef0ec81cb 100644
--- a/src/native/public/monoapi.cmake
+++ b/src/native/public/monoapi.cmake
@@ -9,7 +9,18 @@ set(utils_public_headers_base
     mono-jemalloc.h
     mono-dl-fallback.h
     mono-private-unstable.h
-    mono-counters.h)
+    mono-counters.h
+    details/mono-publib-types.h
+    details/mono-publib-functions.h
+    details/mono-logger-types.h
+    details/mono-logger-functions.h
+    details/mono-error-types.h
+    details/mono-error-functions.h
+    details/mono-dl-fallback-types.h
+    details/mono-dl-fallback-functions.h
+    details/mono-counters-types.h
+    details/mono-counters-functions.h
+    )
 addprefix(utils_public_headers ./mono/utils "${utils_public_headers_base}")
 
 target_sources(monoapi_utils INTERFACE ${utils_public_headers})

From 15fea4a21b4cc1593d0fe6d26c0c3acb1692d6cd Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Wed, 16 Feb 2022 14:05:03 -0500
Subject: [PATCH 02/14] [monoapi] Use cmake install(DIRECTORY) instead of
 install(TARGETS)

install(TARGETS) flattens subdirectories  (so all the details/ headers ended up
in the respective parent directory)
---
 src/native/public/monoapi.cmake | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake
index 44d88ef0ec81cb..555eb7371a5c38 100644
--- a/src/native/public/monoapi.cmake
+++ b/src/native/public/monoapi.cmake
@@ -76,7 +76,7 @@ add_library(monoapi INTERFACE)
 target_link_libraries(monoapi INTERFACE monoapi_utils monoapi_metadata monoapi_mini)
 
 if(INSTALL_MONO_API)
-  install(TARGETS monoapi_utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/utils)
-  install(TARGETS monoapi_metadata PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/metadata)
-  install(TARGETS monoapi_mini PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit)
+  install(DIRECTORY mono/utils/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/utils)
+  install(DIRECTORY mono/metadata/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/metadata)
+  install(DIRECTORY mono/mini/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit)
 endif()

From 8036b64a0ab1395a72e18c5c9468bb02ce5414b8 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Wed, 16 Feb 2022 13:17:16 -0500
Subject: [PATCH 03/14] Split metadata headers too

---
 src/native/public/mono/metadata/appdomain.h   | 217 +-------
 src/native/public/mono/metadata/assembly.h    | 126 +----
 src/native/public/mono/metadata/class.h       | 300 +----------
 .../public/mono/metadata/debug-helpers.h      |  46 +-
 .../metadata/details/appdomain-functions.h    | 140 ++++++
 .../mono/metadata/details/appdomain-types.h   |  26 +
 .../metadata/details/assembly-functions.h     |  78 +++
 .../mono/metadata/details/assembly-types.h    |  38 ++
 .../mono/metadata/details/class-functions.h   | 185 +++++++
 .../mono/metadata/details/class-types.h       |  29 ++
 .../details/debug-helpers-functions.h         |  32 ++
 .../metadata/details/debug-helpers-types.h    |  29 ++
 .../metadata/details/environment-functions.h  |  12 +
 .../metadata/details/exception-functions.h    | 100 ++++
 .../mono/metadata/details/exception-types.h   |  18 +
 .../mono/metadata/details/image-functions.h   |  57 +++
 .../mono/metadata/details/image-types.h       |  28 ++
 .../mono/metadata/details/loader-functions.h  |  66 +++
 .../mono/metadata/details/loader-types.h      |  20 +
 .../metadata/details/metadata-functions.h     | 159 ++++++
 .../mono/metadata/details/metadata-types.h    | 257 ++++++++++
 .../metadata/details/mono-config-functions.h  |  28 ++
 .../mono/metadata/details/mono-config-types.h |  14 +
 .../metadata/details/mono-debug-functions.h   |  66 +++
 .../mono/metadata/details/mono-debug-types.h  | 154 ++++++
 .../mono/metadata/details/mono-gc-functions.h |  23 +
 .../mono/metadata/details/mono-gc-types.h     | 114 +++++
 .../details/mono-private-unstable-functions.h |  21 +
 .../details/mono-private-unstable-types.h     |  22 +
 .../mono/metadata/details/object-functions.h  | 224 +++++++++
 .../mono/metadata/details/object-types.h      |  44 ++
 .../mono/metadata/details/opcodes-functions.h |  12 +
 .../mono/metadata/details/opcodes-types.h     |  62 +++
 .../metadata/details/profiler-functions.h     |  30 ++
 .../mono/metadata/details/profiler-types.h    | 131 +++++
 .../metadata/details/reflection-functions.h   |  66 +++
 .../mono/metadata/details/reflection-types.h  |  88 ++++
 .../metadata/details/sgen-bridge-functions.h  |  19 +
 .../mono/metadata/details/sgen-bridge-types.h |  55 ++
 .../mono/metadata/details/threads-functions.h |  43 ++
 .../mono/metadata/details/threads-types.h     |  18 +
 src/native/public/mono/metadata/environment.h |   5 +-
 src/native/public/mono/metadata/exception.h   | 165 +-----
 src/native/public/mono/metadata/image.h       |  87 +---
 src/native/public/mono/metadata/loader.h      |  98 +---
 src/native/public/mono/metadata/metadata.h    | 471 +-----------------
 src/native/public/mono/metadata/mono-config.h |  24 +-
 src/native/public/mono/metadata/mono-debug.h  | 219 +-------
 src/native/public/mono/metadata/mono-gc.h     | 121 +----
 .../mono/metadata/mono-private-unstable.h     |  29 +-
 .../public/mono/metadata/object-forward.h     |   2 +-
 src/native/public/mono/metadata/object.h      | 360 +------------
 src/native/public/mono/metadata/opcodes.h     |  63 +--
 src/native/public/mono/metadata/profiler.h    | 144 +-----
 src/native/public/mono/metadata/reflection.h  | 164 +-----
 src/native/public/mono/metadata/sgen-bridge.h |  55 +-
 src/native/public/mono/metadata/threads.h     |  53 +-
 src/native/public/monoapi.cmake               |  40 +-
 58 files changed, 2627 insertions(+), 2670 deletions(-)
 create mode 100644 src/native/public/mono/metadata/details/appdomain-functions.h
 create mode 100644 src/native/public/mono/metadata/details/appdomain-types.h
 create mode 100644 src/native/public/mono/metadata/details/assembly-functions.h
 create mode 100644 src/native/public/mono/metadata/details/assembly-types.h
 create mode 100644 src/native/public/mono/metadata/details/class-functions.h
 create mode 100644 src/native/public/mono/metadata/details/class-types.h
 create mode 100644 src/native/public/mono/metadata/details/debug-helpers-functions.h
 create mode 100644 src/native/public/mono/metadata/details/debug-helpers-types.h
 create mode 100644 src/native/public/mono/metadata/details/environment-functions.h
 create mode 100644 src/native/public/mono/metadata/details/exception-functions.h
 create mode 100644 src/native/public/mono/metadata/details/exception-types.h
 create mode 100644 src/native/public/mono/metadata/details/image-functions.h
 create mode 100644 src/native/public/mono/metadata/details/image-types.h
 create mode 100644 src/native/public/mono/metadata/details/loader-functions.h
 create mode 100644 src/native/public/mono/metadata/details/loader-types.h
 create mode 100644 src/native/public/mono/metadata/details/metadata-functions.h
 create mode 100644 src/native/public/mono/metadata/details/metadata-types.h
 create mode 100644 src/native/public/mono/metadata/details/mono-config-functions.h
 create mode 100644 src/native/public/mono/metadata/details/mono-config-types.h
 create mode 100644 src/native/public/mono/metadata/details/mono-debug-functions.h
 create mode 100644 src/native/public/mono/metadata/details/mono-debug-types.h
 create mode 100644 src/native/public/mono/metadata/details/mono-gc-functions.h
 create mode 100644 src/native/public/mono/metadata/details/mono-gc-types.h
 create mode 100644 src/native/public/mono/metadata/details/mono-private-unstable-functions.h
 create mode 100644 src/native/public/mono/metadata/details/mono-private-unstable-types.h
 create mode 100644 src/native/public/mono/metadata/details/object-functions.h
 create mode 100644 src/native/public/mono/metadata/details/object-types.h
 create mode 100644 src/native/public/mono/metadata/details/opcodes-functions.h
 create mode 100644 src/native/public/mono/metadata/details/opcodes-types.h
 create mode 100644 src/native/public/mono/metadata/details/profiler-functions.h
 create mode 100644 src/native/public/mono/metadata/details/profiler-types.h
 create mode 100644 src/native/public/mono/metadata/details/reflection-functions.h
 create mode 100644 src/native/public/mono/metadata/details/reflection-types.h
 create mode 100644 src/native/public/mono/metadata/details/sgen-bridge-functions.h
 create mode 100644 src/native/public/mono/metadata/details/sgen-bridge-types.h
 create mode 100644 src/native/public/mono/metadata/details/threads-functions.h
 create mode 100644 src/native/public/mono/metadata/details/threads-types.h

diff --git a/src/native/public/mono/metadata/appdomain.h b/src/native/public/mono/metadata/appdomain.h
index b92b9cc854067a..e32d2a566f2573 100644
--- a/src/native/public/mono/metadata/appdomain.h
+++ b/src/native/public/mono/metadata/appdomain.h
@@ -11,222 +11,13 @@
 #ifndef _MONO_METADATA_APPDOMAIN_H_
 #define _MONO_METADATA_APPDOMAIN_H_
 
-#include <mono/utils/mono-publib.h>
-
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/reflection.h>
+#include <mono/metadata/details/appdomain-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef void (*MonoThreadStartCB) (intptr_t tid, void* stack_start,
-				   void* func);
-typedef void (*MonoThreadAttachCB) (intptr_t tid, void* stack_start);
-
-typedef struct _MonoAppDomain MonoAppDomain;
-
-typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data);
-
-MONO_API MonoDomain*
-mono_init                  (const char *filename);
-
-MONO_API MonoDomain *
-mono_init_from_assembly    (const char *domain_name, const char *filename);
-
-MONO_API MonoDomain *
-mono_init_version          (const char *domain_name, const char *version);
-
-MONO_API MonoDomain*
-mono_get_root_domain       (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_init          (MonoDomain *domain, MonoThreadStartCB start_cb,
-			    MonoThreadAttachCB attach_cb);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_cleanup       (MonoDomain *domain);
-
-MONO_API void
-mono_install_runtime_cleanup (MonoDomainFunc func);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_quit (void);
-
-MONO_API void
-mono_runtime_set_shutting_down (void);
-
-MONO_API mono_bool
-mono_runtime_is_shutting_down (void);
-
-MONO_API const char*
-mono_check_corlib_version (void);
-
-MONO_API MonoDomain *
-mono_domain_create         (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
-mono_domain_create_appdomain (char *friendly_name, char *configuration_file);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_set_config (MonoDomain *domain, const char *base_dir, const char *config_file_name);
-
-MONO_API MonoDomain *
-mono_domain_get            (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
-mono_domain_get_by_id      (int32_t domainid);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int32_t
-mono_domain_get_id         (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY const char *
-mono_domain_get_friendly_name (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_domain_set            (MonoDomain *domain, mono_bool force);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_set_internal   (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_unload (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_try_unload (MonoDomain *domain, MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_domain_is_unloading   (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
-mono_domain_from_appdomain (MonoAppDomain *appdomain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_foreach        (MonoDomainFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *
-mono_domain_assembly_open  (MonoDomain *domain, const char *name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_ensure_entry_assembly (MonoDomain *domain, MonoAssembly *assembly);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_domain_finalize       (MonoDomain *domain, uint32_t timeout);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_domain_free           (MonoDomain *domain, mono_bool force);
-
-MONO_API mono_bool
-mono_domain_has_type_resolve (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly *
-mono_domain_try_type_resolve (MonoDomain *domain, char *name, MonoObject *tb);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_domain_owns_vtable_slot (MonoDomain *domain, void* vtable_slot);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_context_init 				   (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_context_set				   (MonoAppContext *new_context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoAppContext *
-mono_context_get				   (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int32_t
-mono_context_get_id         (MonoAppContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int32_t
-mono_context_get_domain_id  (MonoAppContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoJitInfo *
-mono_jit_info_table_find   (MonoDomain *domain, void* addr);
-
-/* MonoJitInfo accessors */
-
-MONO_API void*
-mono_jit_info_get_code_start (MonoJitInfo* ji);
-
-MONO_API int
-mono_jit_info_get_code_size (MonoJitInfo* ji);
-
-MONO_API MonoMethod*
-mono_jit_info_get_method (MonoJitInfo* ji);
-
-
-MONO_API MonoImage*
-mono_get_corlib            (void);
-
-MONO_API MonoClass*
-mono_get_object_class      (void);
-
-MONO_API MonoClass*
-mono_get_byte_class        (void);
-
-MONO_API MonoClass*
-mono_get_void_class        (void);
-
-MONO_API MonoClass*
-mono_get_boolean_class     (void);
-
-MONO_API MonoClass*
-mono_get_sbyte_class       (void);
-
-MONO_API MonoClass*
-mono_get_int16_class       (void);
-
-MONO_API MonoClass*
-mono_get_uint16_class      (void);
-
-MONO_API MonoClass*
-mono_get_int32_class       (void);
-
-MONO_API MonoClass*
-mono_get_uint32_class      (void);
-
-MONO_API MonoClass*
-mono_get_intptr_class         (void);
-
-MONO_API MonoClass*
-mono_get_uintptr_class        (void);
-
-MONO_API MonoClass*
-mono_get_int64_class       (void);
-
-MONO_API MonoClass*
-mono_get_uint64_class      (void);
-
-MONO_API MonoClass*
-mono_get_single_class      (void);
-
-MONO_API MonoClass*
-mono_get_double_class      (void);
-
-MONO_API MonoClass*
-mono_get_char_class        (void);
-
-MONO_API MonoClass*
-mono_get_string_class      (void);
-
-MONO_API MonoClass*
-mono_get_enum_class        (void);
-
-MONO_API MonoClass*
-mono_get_array_class       (void);
-
-MONO_API MonoClass*
-mono_get_thread_class       (void);
-
-MONO_API MonoClass*
-mono_get_exception_class    (void);
-
-MONO_API void
-mono_security_enable_core_clr (void);
-
-typedef mono_bool (*MonoCoreClrPlatformCB) (const char *image_name);
-
-MONO_API void
-mono_security_set_core_clr_platform_callback (MonoCoreClrPlatformCB callback);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/appdomain-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/assembly.h b/src/native/public/mono/metadata/assembly.h
index 9f55a3db8114c0..1c4b80676f7e95 100644
--- a/src/native/public/mono/metadata/assembly.h
+++ b/src/native/public/mono/metadata/assembly.h
@@ -5,132 +5,14 @@
 #ifndef _MONONET_METADATA_ASSEMBLY_H_
 #define _MONONET_METADATA_ASSEMBLY_H_
 
-#include <mono/utils/mono-error.h>
-#include <mono/metadata/image.h>
+#include <mono/metadata/details/assembly-types.h>
 
 MONO_BEGIN_DECLS
 
-MONO_API void          mono_assemblies_init     (void);
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_assemblies_cleanup  (void);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly *mono_assembly_open       (const char *filename,
-				       	MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly *mono_assembly_open_full (const char *filename,
-				       	MonoImageOpenStatus *status,
-					mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load       (MonoAssemblyName *aname,
-                                       	const char       *basedir,
-				     	MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_full (MonoAssemblyName *aname,
-                                       	const char       *basedir,
-				     	MonoImageOpenStatus *status,
-					mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_from  (MonoImage *image, const char *fname,
-					MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_from_full  (MonoImage *image, const char *fname,
-					MonoImageOpenStatus *status,
-					mono_bool refonly);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/assembly-functions.h>
+#undef MONO_API_FUNCTION
 
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_loaded     (MonoAssemblyName *aname);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_loaded_full (MonoAssemblyName *aname, mono_bool refonly);
-MONO_API void          mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname);
-MONO_API void          mono_assembly_load_reference (MonoImage *image, int index);
-MONO_API void          mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*    mono_assembly_load_module (MonoAssembly *assembly, uint32_t idx);
-MONO_API void          mono_assembly_close      (MonoAssembly *assembly);
-MONO_API void          mono_assembly_setrootdir (const char *root_dir);
-MONO_API MONO_CONST_RETURN char *mono_assembly_getrootdir (void);
-MONO_API char         *mono_native_getrootdir (void);
-MONO_API void	       mono_assembly_foreach    (MonoFunc func, void* user_data);
-MONO_API void          mono_assembly_set_main   (MonoAssembly *assembly);
-MONO_API MonoAssembly *mono_assembly_get_main   (void);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_assembly_get_image  (MonoAssembly *assembly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssemblyName *mono_assembly_get_name (MonoAssembly *assembly);
-MONO_API mono_bool      mono_assembly_fill_assembly_name (MonoImage *image, MonoAssemblyName *aname);
-MONO_API mono_bool      mono_assembly_names_equal (MonoAssemblyName *l, MonoAssemblyName *r);
-MONO_API char*         mono_stringify_assembly_name (MonoAssemblyName *aname);
-
-/* Installs a function which is called each time a new assembly is loaded. */
-typedef void  (*MonoAssemblyLoadFunc)         (MonoAssembly *assembly, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data);
-
-/*
- * Installs a new function which is used to search the list of loaded
- * assemblies for a given assembly name.
- */
-typedef MonoAssembly *(*MonoAssemblySearchFunc)         (MonoAssemblyName *aname, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void          mono_install_assembly_search_hook (MonoAssemblySearchFunc func, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void 	      mono_install_assembly_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname);
-
-/*
- * Installs a new search function which is used as a last resort when loading
- * an assembly fails. This could invoke AssemblyResolve events.
- */
-MONO_API MONO_RT_EXTERNAL_ONLY
-void
-mono_install_assembly_postload_search_hook (MonoAssemblySearchFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void
-mono_install_assembly_postload_refonly_search_hook (MonoAssemblySearchFunc func, void* user_data);
-
-
-/* Installs a function which is called before a new assembly is loaded
- * The hook are invoked from last hooked to first. If any of them returns
- * a non-null value, that will be the value returned in mono_assembly_load */
-typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
-						   char **assemblies_path,
-						   void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void          mono_install_assembly_preload_hook (MonoAssemblyPreLoadFunc func, void* user_data);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void          mono_install_assembly_refonly_preload_hook (MonoAssemblyPreLoadFunc func, void* user_data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_assembly_invoke_load_hook (MonoAssembly *ass);
-
-MONO_API MonoAssemblyName* mono_assembly_name_new             (const char *name);
-MONO_API const char*       mono_assembly_name_get_name        (MonoAssemblyName *aname);
-MONO_API const char*       mono_assembly_name_get_culture     (MonoAssemblyName *aname);
-MONO_API uint16_t          mono_assembly_name_get_version     (MonoAssemblyName *aname,
-						      uint16_t *minor, uint16_t *build, uint16_t *revision);
-MONO_API mono_byte*        mono_assembly_name_get_pubkeytoken (MonoAssemblyName *aname);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_assembly_name_free   (MonoAssemblyName *aname);
-
-typedef struct {
-	const char *name;
-	const unsigned char *data;
-	unsigned int size;
-} MonoBundledAssembly;
-
-MONO_API void          mono_register_bundled_assemblies (const MonoBundledAssembly **assemblies);
-MONO_API MONO_RT_EXTERNAL_ONLY void          mono_register_config_for_assembly (const char* assembly_name, const char* config_xml);
-MONO_API void          mono_register_symfile_for_assembly (const char* assembly_name, const mono_byte *raw_contents, int size);
-MONO_API void	      mono_register_machine_config (const char *config_xml);
-
-MONO_API void          mono_set_rootdir (void);
-MONO_API void          mono_set_dirs (const char *assembly_dir, const char *config_dir);
-MONO_API void          mono_set_assemblies_path (const char* path);
 MONO_END_DECLS
 
 #endif
diff --git a/src/native/public/mono/metadata/class.h b/src/native/public/mono/metadata/class.h
index a9fada0d31a3c0..0e59115d7d96ac 100644
--- a/src/native/public/mono/metadata/class.h
+++ b/src/native/public/mono/metadata/class.h
@@ -10,303 +10,13 @@
 #include <mono/metadata/loader.h>
 #include <mono/utils/mono-error.h>
 
-MONO_BEGIN_DECLS
-
-typedef struct MonoVTable MonoVTable;
-
-typedef struct _MonoClassField MonoClassField;
-typedef struct _MonoProperty MonoProperty;
-typedef struct _MonoEvent MonoEvent;
-
-typedef enum {
-	MONO_TYPE_NAME_FORMAT_IL,
-	MONO_TYPE_NAME_FORMAT_REFLECTION,
-	MONO_TYPE_NAME_FORMAT_FULL_NAME,
-	MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
-} MonoTypeNameFormat;
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_class_get             (MonoImage *image, uint32_t type_token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_class_get_full        (MonoImage *image, uint32_t type_token, MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_init            (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoVTable *
-mono_class_vtable          (MonoDomain *domain, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_name       (MonoImage *image, const char* name_space, const char *name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_name_case  (MonoImage *image, const char* name_space, const char *name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_class_get_method_from_name_flags (MonoClass *klass, const char *name, int param_count, int flags);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_typeref    (MonoImage *image, uint32_t type_token);
-
-MONO_API MonoClass *
-mono_class_from_typeref_checked (MonoImage *image, uint32_t type_token, MonoError *error);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_class_from_generic_parameter (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_class_inflate_generic_type (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */;
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethod*
-mono_class_inflate_generic_method (MonoMethod *method, MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethod *
-mono_get_inflated_method (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClassField*
-mono_field_from_token      (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_bounded_array_class_get (MonoClass *element_class, uint32_t rank, mono_bool bounded);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_array_class_get       (MonoClass *element_class, uint32_t rank);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass *
-mono_ptr_class_get         (MonoType *type);
-
-MONO_API MonoClassField *
-mono_class_get_field       (MonoClass *klass, uint32_t field_token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClassField *
-mono_class_get_field_from_name (MonoClass *klass, const char *name);
-
-MONO_API uint32_t
-mono_class_get_field_token (MonoClassField *field);
-
-MONO_API uint32_t
-mono_class_get_event_token (MonoEvent *event);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoProperty *
-mono_class_get_property_from_name (MonoClass *klass, const char *name);
-
-MONO_API uint32_t
-mono_class_get_property_token (MonoProperty *prop);
-
-MONO_API int32_t
-mono_array_element_size    (MonoClass *ac);
-
-MONO_API int32_t
-mono_class_instance_size   (MonoClass *klass);
-
-MONO_API int32_t
-mono_class_array_element_size (MonoClass *klass);
-
-MONO_API int32_t
-mono_class_data_size       (MonoClass *klass);
-
-MONO_API int32_t
-mono_class_value_size      (MonoClass *klass, uint32_t *align);
-
-MONO_API int32_t
-mono_class_min_align       (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *
-mono_class_from_mono_type  (MonoType *type);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc,
-						   mono_bool check_interfaces);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void*
-mono_ldtoken               (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context);
-
-MONO_API char *
-mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format);
-
-MONO_API char*
-mono_type_get_name         (MonoType *type);
-
-MONO_API MonoType*
-mono_type_get_underlying_type (MonoType *type);
-
-/* MonoClass accessors */
-MONO_API MonoImage*
-mono_class_get_image         (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass*
-mono_class_get_element_class (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-mono_bool
-mono_class_is_valuetype      (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-mono_bool
-mono_class_is_enum          (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_class_enum_basetype    (MonoClass *klass);
+#include <mono/metadata/details/class-types.h>
 
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass*
-mono_class_get_parent        (MonoClass *klass);
-
-MONO_API MonoClass*
-mono_class_get_nesting_type  (MonoClass *klass);
-
-MONO_API int
-mono_class_get_rank          (MonoClass *klass);
-
-MONO_API uint32_t
-mono_class_get_flags         (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-const char*
-mono_class_get_name          (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-const char*
-mono_class_get_namespace     (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_class_get_type          (MonoClass *klass);
-
-MONO_API uint32_t
-mono_class_get_type_token    (MonoClass *klass);
-
-MONO_API MonoType*
-mono_class_get_byref_type    (MonoClass *klass);
-
-MONO_API int
-mono_class_num_fields        (MonoClass *klass);
-
-MONO_API int
-mono_class_num_methods       (MonoClass *klass);
-
-MONO_API int
-mono_class_num_properties    (MonoClass *klass);
-
-MONO_API int
-mono_class_num_events        (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClassField*
-mono_class_get_fields        (MonoClass* klass, void **iter);
-
-MONO_API MonoMethod*
-mono_class_get_methods       (MonoClass* klass, void **iter);
-
-MONO_API MonoProperty*
-mono_class_get_properties    (MonoClass* klass, void **iter);
-
-MONO_API MonoEvent*
-mono_class_get_events        (MonoClass* klass, void **iter);
-
-MONO_API MonoClass*
-mono_class_get_interfaces    (MonoClass* klass, void **iter);
-
-MONO_API MonoClass*
-mono_class_get_nested_types  (MonoClass* klass, void **iter);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-mono_bool
-mono_class_is_delegate       (MonoClass* klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_class_implements_interface (MonoClass* klass, MonoClass* iface);
-
-/* MonoClassField accessors */
-MONO_API const char*
-mono_field_get_name   (MonoClassField *field);
-
-MONO_API MonoType*
-mono_field_get_type   (MonoClassField *field);
-
-MONO_API MonoClass*
-mono_field_get_parent (MonoClassField *field);
-
-MONO_API uint32_t
-mono_field_get_flags  (MonoClassField *field);
-
-MONO_API uint32_t
-mono_field_get_offset  (MonoClassField *field);
-
-MONO_API const char *
-mono_field_get_data  (MonoClassField *field);
-
-/* MonoProperty acessors */
-MONO_API const char*
-mono_property_get_name       (MonoProperty *prop);
-
-MONO_API MonoMethod*
-mono_property_get_set_method (MonoProperty *prop);
-
-MONO_API MonoMethod*
-mono_property_get_get_method (MonoProperty *prop);
-
-MONO_API MonoClass*
-mono_property_get_parent     (MonoProperty *prop);
-
-MONO_API uint32_t
-mono_property_get_flags      (MonoProperty *prop);
-
-/* MonoEvent accessors */
-MONO_API const char*
-mono_event_get_name          (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_add_method    (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_remove_method (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_remove_method (MonoEvent *event);
-
-MONO_API MonoMethod*
-mono_event_get_raise_method  (MonoEvent *event);
-
-MONO_API MonoClass*
-mono_event_get_parent        (MonoEvent *event);
-
-MONO_API uint32_t
-mono_event_get_flags         (MonoEvent *event);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_class_get_method_from_name (MonoClass *klass, const char *name, int param_count);
-
-MONO_API char *
-mono_class_name_from_token (MonoImage *image, uint32_t type_token);
-
-MONO_API mono_bool
-mono_method_can_access_field (MonoMethod *method, MonoClassField *field);
-
-MONO_API mono_bool
-mono_method_can_access_method (MonoMethod *method, MonoMethod *called);
-
-MONO_API mono_bool
-mono_class_is_nullable (MonoClass *klass);
+MONO_BEGIN_DECLS
 
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_class_get_nullable_param (MonoClass *klass);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/class-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/debug-helpers.h b/src/native/public/mono/metadata/debug-helpers.h
index 795eb53d72429f..515a17e6418ff5 100644
--- a/src/native/public/mono/metadata/debug-helpers.h
+++ b/src/native/public/mono/metadata/debug-helpers.h
@@ -5,51 +5,13 @@
 #ifndef __MONO_DEBUG_HELPERS_H__
 #define __MONO_DEBUG_HELPERS_H__
 
-#include <mono/metadata/class.h>
+#include <mono/metadata/details/debug-helpers-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef struct MonoDisHelper MonoDisHelper;
-
-typedef char* (*MonoDisIndenter) (MonoDisHelper *dh, MonoMethod *method, uint32_t ip_offset);
-typedef char* (*MonoDisTokener)  (MonoDisHelper *dh, MonoMethod *method, uint32_t token);
-
-struct MonoDisHelper {
-	const char *newline;
-	const char *label_format;
-	const char *label_target;
-	MonoDisIndenter indenter;
-	MonoDisTokener  tokener;
-	void* user_data;
-};
-
-MONO_API char* mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte** endp);
-MONO_API char* mono_disasm_code     (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte* end);
-
-typedef struct MonoMethodDesc MonoMethodDesc;
-
-MONO_API char*           mono_type_full_name (MonoType *type);
-
-MONO_API char*           mono_signature_get_desc (MonoMethodSignature *sig, mono_bool include_namespace);
-
-MONO_API char*           mono_context_get_desc (MonoGenericContext *context);
-
-MONO_API MonoMethodDesc* mono_method_desc_new (const char *name, mono_bool include_namespace);
-MONO_API MonoMethodDesc* mono_method_desc_from_method (MonoMethod *method);
-MONO_API void            mono_method_desc_free (MonoMethodDesc *desc);
-MONO_API mono_bool       mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method);
-MONO_API mono_bool       mono_method_desc_is_full (MonoMethodDesc *desc);
-MONO_API mono_bool       mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method);
-MONO_API MonoMethod*     mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass);
-MONO_API MonoMethod*     mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image);
-
-MONO_API char*           mono_method_full_name (MonoMethod *method, mono_bool signature);
-MONO_API char*           mono_method_get_reflection_name (MonoMethod *method);
-
-MONO_API char*           mono_field_full_name (MonoClassField *field);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_debugger_agent_unhandled_exception (MonoException *e);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/debug-helpers-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/details/appdomain-functions.h b/src/native/public/mono/metadata/details/appdomain-functions.h
new file mode 100644
index 00000000000000..49625f81f5980b
--- /dev/null
+++ b/src/native/public/mono/metadata/details/appdomain-functions.h
@@ -0,0 +1,140 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MonoDomain*, mono_init, (const char *filename))
+
+MONO_API_FUNCTION(MONO_API MonoDomain *, mono_init_from_assembly, (const char *domain_name, const char *filename))
+
+MONO_API_FUNCTION(MONO_API MonoDomain *, mono_init_version, (const char *domain_name, const char *version))
+
+MONO_API_FUNCTION(MONO_API MonoDomain*, mono_get_root_domain, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_init, (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_cleanup, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API void, mono_install_runtime_cleanup, (MonoDomainFunc func))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_quit, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_runtime_set_shutting_down, (void))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_runtime_is_shutting_down, (void))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_check_corlib_version, (void))
+
+MONO_API_FUNCTION(MONO_API MonoDomain *, mono_domain_create, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_create_appdomain, (char *friendly_name, char *configuration_file))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_set_config, (MonoDomain *domain, const char *base_dir, const char *config_file_name))
+
+MONO_API_FUNCTION(MONO_API MonoDomain *, mono_domain_get, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_get_by_id, (int32_t domainid))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int32_t, mono_domain_get_id, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char *, mono_domain_get_friendly_name, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_set, (MonoDomain *domain, mono_bool force))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_set_internal, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_unload, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_try_unload, (MonoDomain *domain, MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_is_unloading, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_from_appdomain, (MonoAppDomain *appdomain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_foreach, (MonoDomainFunc func, void* user_data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_domain_assembly_open, (MonoDomain *domain, const char *name))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_ensure_entry_assembly, (MonoDomain *domain, MonoAssembly *assembly))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_finalize, (MonoDomain *domain, uint32_t timeout))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_free, (MonoDomain *domain, mono_bool force))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_domain_has_type_resolve, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly *, mono_domain_try_type_resolve, (MonoDomain *domain, char *name, MonoObject *tb))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_owns_vtable_slot, (MonoDomain *domain, void* vtable_slot))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_context_init, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_context_set, (MonoAppContext *new_context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAppContext *, mono_context_get, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_id, (MonoAppContext *context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_domain_id, (MonoAppContext *context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoJitInfo *, mono_jit_info_table_find, (MonoDomain *domain, void* addr))
+
+/* MonoJitInfo accessors */
+
+MONO_API_FUNCTION(MONO_API void*, mono_jit_info_get_code_start, (MonoJitInfo* ji))
+
+MONO_API_FUNCTION(MONO_API int, mono_jit_info_get_code_size, (MonoJitInfo* ji))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_jit_info_get_method, (MonoJitInfo* ji))
+
+
+MONO_API_FUNCTION(MONO_API MonoImage*, mono_get_corlib, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_object_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_byte_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_void_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_boolean_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_sbyte_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_int16_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uint16_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_int32_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uint32_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_intptr_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uintptr_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_int64_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uint64_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_single_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_double_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_char_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_string_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_enum_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_array_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_thread_class, (void))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_exception_class, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_security_enable_core_clr, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_security_set_core_clr_platform_callback, (MonoCoreClrPlatformCB callback))
diff --git a/src/native/public/mono/metadata/details/appdomain-types.h b/src/native/public/mono/metadata/details/appdomain-types.h
new file mode 100644
index 00000000000000..b30eb3d4566a01
--- /dev/null
+++ b/src/native/public/mono/metadata/details/appdomain-types.h
@@ -0,0 +1,26 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_APPDOMAIN_TYPES_H
+#define _MONO_APPDOMAIN_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/utils/mono-forward.h>
+#include <mono/metadata/details/object-types.h>
+#include <mono/metadata/details/reflection-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef void (*MonoThreadStartCB) (intptr_t tid, void* stack_start,
+				   void* func);
+typedef void (*MonoThreadAttachCB) (intptr_t tid, void* stack_start);
+
+typedef struct _MonoAppDomain MonoAppDomain;
+
+typedef void (*MonoDomainFunc) (MonoDomain *domain, void* user_data);
+
+typedef mono_bool (*MonoCoreClrPlatformCB) (const char *image_name);
+
+MONO_END_DECLS
+
+#endif /* _MONO_APPDOMAIN_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/assembly-functions.h b/src/native/public/mono/metadata/details/assembly-functions.h
new file mode 100644
index 00000000000000..76b3c648b4cb1b
--- /dev/null
+++ b/src/native/public/mono/metadata/details/assembly-functions.h
@@ -0,0 +1,78 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_assemblies_init, (void))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_assemblies_cleanup, (void))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open, (const char *filename, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open_full, (const char *filename, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_full, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from,  (MonoImage *image, const char *fname, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from_full, (MonoImage *image, const char *fname, MonoImageOpenStatus *status, mono_bool refonly))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_with_partial_name, (const char *name, MonoImageOpenStatus *status))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded_full, (MonoAssemblyName *aname, mono_bool refonly))
+MONO_API_FUNCTION(MONO_API void, mono_assembly_get_assemblyref, (MonoImage *image, int index, MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_API void, mono_assembly_load_reference, (MonoImage *image, int index))
+MONO_API_FUNCTION(MONO_API void, mono_assembly_load_references, (MonoImage *image, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*, mono_assembly_load_module, (MonoAssembly *assembly, uint32_t idx))
+MONO_API_FUNCTION(MONO_API void, mono_assembly_close, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_API void, mono_assembly_setrootdir, (const char *root_dir))
+MONO_API_FUNCTION(MONO_API MONO_CONST_RETURN char *, mono_assembly_getrootdir, (void))
+MONO_API_FUNCTION(MONO_API char *, mono_native_getrootdir, (void))
+MONO_API_FUNCTION(MONO_API void, mono_assembly_foreach, (MonoFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_API void, mono_assembly_set_main, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_API MonoAssembly *, mono_assembly_get_main, (void))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_assembly_get_image, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssemblyName *, mono_assembly_get_name, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_assembly_fill_assembly_name, (MonoImage *image, MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_assembly_names_equal, (MonoAssemblyName *l, MonoAssemblyName *r))
+MONO_API_FUNCTION(MONO_API char*, mono_stringify_assembly_name, (MonoAssemblyName *aname))
+
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_load_hook, (MonoAssemblyLoadFunc func, void* user_data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_invoke_search_hook, (MonoAssemblyName *aname))
+
+/*
+ * Installs a new search function which is used as a last resort when loading
+ * an assembly fails. This could invoke AssemblyResolve events.
+ */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_assembly_invoke_load_hook, (MonoAssembly *ass))
+
+MONO_API_FUNCTION(MONO_API MonoAssemblyName*, mono_assembly_name_new, (const char *name))
+MONO_API_FUNCTION(MONO_API const char*, mono_assembly_name_get_name, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_API const char*, mono_assembly_name_get_culture, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_API uint16_t, mono_assembly_name_get_version, (MonoAssemblyName *aname, uint16_t *minor, uint16_t *build, uint16_t *revision))
+MONO_API_FUNCTION(MONO_API mono_byte*, mono_assembly_name_get_pubkeytoken, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_assembly_name_free, (MonoAssemblyName *aname))
+
+MONO_API_FUNCTION(MONO_API void, mono_register_bundled_assemblies, (const MonoBundledAssembly **assemblies))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_register_config_for_assembly, (const char* assembly_name, const char* config_xml))
+MONO_API_FUNCTION(MONO_API void, mono_register_symfile_for_assembly, (const char* assembly_name, const mono_byte *raw_contents, int size))
+MONO_API_FUNCTION(MONO_API void, mono_register_machine_config, (const char *config_xml))
+
+MONO_API_FUNCTION(MONO_API void, mono_set_rootdir, (void))
+MONO_API_FUNCTION(MONO_API void, mono_set_dirs, (const char *assembly_dir, const char *config_dir))
+MONO_API_FUNCTION(MONO_API void, mono_set_assemblies_path, (const char* path))
+
+
+
diff --git a/src/native/public/mono/metadata/details/assembly-types.h b/src/native/public/mono/metadata/details/assembly-types.h
new file mode 100644
index 00000000000000..cfe8f439dac581
--- /dev/null
+++ b/src/native/public/mono/metadata/details/assembly-types.h
@@ -0,0 +1,38 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_ASSEMBLY_TYPES_H
+#define _MONO_ASSEMBLY_TYPES_H
+
+#include <mono/utils/details/mono-error-types.h>
+#include <mono/metadata/details/image-types.h>
+
+MONO_BEGIN_DECLS
+
+/* Installs a function which is called each time a new assembly is loaded. */
+typedef void  (*MonoAssemblyLoadFunc)         (MonoAssembly *assembly, void* user_data);
+
+/*
+ * Installs a new function which is used to search the list of loaded
+ * assemblies for a given assembly name.
+ */
+typedef MonoAssembly *(*MonoAssemblySearchFunc)         (MonoAssemblyName *aname, void* user_data);
+
+/* Installs a function which is called before a new assembly is loaded
+ * The hook are invoked from last hooked to first. If any of them returns
+ * a non-null value, that will be the value returned in mono_assembly_load */
+typedef MonoAssembly * (*MonoAssemblyPreLoadFunc) (MonoAssemblyName *aname,
+						   char **assemblies_path,
+						   void* user_data);
+
+typedef struct {
+	const char *name;
+	const unsigned char *data;
+	unsigned int size;
+} MonoBundledAssembly;
+
+
+
+MONO_END_DECLS
+
+#endif /* _MONO_ASSEMBLY_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/class-functions.h b/src/native/public/mono/metadata/details/class-functions.h
new file mode 100644
index 00000000000000..76b4b0614f2dc5
--- /dev/null
+++ b/src/native/public/mono/metadata/details/class-functions.h
@@ -0,0 +1,185 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get, (MonoImage *image, uint32_t type_token))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get_full, (MonoImage *image, uint32_t type_token, MonoGenericContext *context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_init, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoVTable *, mono_class_vtable, (MonoDomain *domain, MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name, (MonoImage *image, const char* name_space, const char *name))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name_case, (MonoImage *image, const char* name_space, const char *name))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name_flags, (MonoClass *klass, const char *name, int param_count, int flags))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_typeref, (MonoImage *image, uint32_t type_token))
+
+MONO_API_FUNCTION(MONO_API MonoClass *, mono_class_from_typeref_checked, (MonoImage *image, uint32_t type_token, MonoError *error))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_generic_parameter, (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_inflate_generic_type, (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */)
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_class_inflate_generic_method, (MonoMethod *method, MonoGenericContext *context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_inflated_method, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_field_from_token, (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_bounded_array_class_get, (MonoClass *element_class, uint32_t rank, mono_bool bounded))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_array_class_get, (MonoClass *element_class, uint32_t rank))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_ptr_class_get, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API MonoClassField *, mono_class_get_field, (MonoClass *klass, uint32_t field_token))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClassField *, mono_class_get_field_from_name, (MonoClass *klass, const char *name))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_field_token, (MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_event_token, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoProperty *, mono_class_get_property_from_name, (MonoClass *klass, const char *name))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_property_token, (MonoProperty *prop))
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_array_element_size, (MonoClass *ac))
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_class_instance_size, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_class_array_element_size, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_class_data_size, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_class_value_size, (MonoClass *klass, uint32_t *align))
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_class_min_align, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_mono_type, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_subclass_of, (MonoClass *klass, MonoClass *klassc, mono_bool check_interfaces))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_assignable_from, (MonoClass *klass, MonoClass *oklass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_ldtoken, (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context))
+
+MONO_API_FUNCTION(MONO_API char *, mono_type_get_name_full, (MonoType *type, MonoTypeNameFormat format))
+
+MONO_API_FUNCTION(MONO_API char*, mono_type_get_name, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API MonoType*, mono_type_get_underlying_type, (MonoType *type))
+
+/* MonoClass accessors */
+MONO_API_FUNCTION(MONO_API MonoImage*, mono_class_get_image, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_element_class, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_valuetype, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_enum, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_enum_basetype, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_parent, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_class_get_nesting_type, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int, mono_class_get_rank, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_flags, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_name, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_namespace, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_get_type, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_type_token, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MonoType*, mono_class_get_byref_type, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int, mono_class_num_fields, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int, mono_class_num_methods, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int, mono_class_num_properties, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API int, mono_class_num_events, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_class_get_fields, (MonoClass* klass, void **iter))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_class_get_methods, (MonoClass* klass, void **iter))
+
+MONO_API_FUNCTION(MONO_API MonoProperty*, mono_class_get_properties, (MonoClass* klass, void **iter))
+
+MONO_API_FUNCTION(MONO_API MonoEvent*, mono_class_get_events, (MonoClass* klass, void **iter))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_class_get_interfaces, (MonoClass* klass, void **iter))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_class_get_nested_types, (MonoClass* klass, void **iter))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_delegate, (MonoClass* klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_implements_interface, (MonoClass* klass, MonoClass* iface))
+
+/* MonoClassField accessors */
+MONO_API_FUNCTION(MONO_API const char*, mono_field_get_name, (MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API MonoType*, mono_field_get_type, (MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_field_get_parent, (MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_field_get_flags, (MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_field_get_offset, (MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API const char *, mono_field_get_data, (MonoClassField *field))
+
+/* MonoProperty acessors */
+MONO_API_FUNCTION(MONO_API const char*, mono_property_get_name, (MonoProperty *prop))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_property_get_set_method, (MonoProperty *prop))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_property_get_get_method, (MonoProperty *prop))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_property_get_parent, (MonoProperty *prop))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_property_get_flags, (MonoProperty *prop))
+
+/* MonoEvent accessors */
+MONO_API_FUNCTION(MONO_API const char*, mono_event_get_name, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_add_method, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_remove_method, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_remove_method, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_raise_method, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_event_get_parent, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_event_get_flags, (MonoEvent *event))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name, (MonoClass *klass, const char *name, int param_count))
+
+MONO_API_FUNCTION(MONO_API char *, mono_class_name_from_token, (MonoImage *image, uint32_t type_token))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_method_can_access_field, (MonoMethod *method, MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_method_can_access_method, (MonoMethod *method, MonoMethod *called))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_class_is_nullable, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_nullable_param, (MonoClass *klass))
+
+
diff --git a/src/native/public/mono/metadata/details/class-types.h b/src/native/public/mono/metadata/details/class-types.h
new file mode 100644
index 00000000000000..716025ed4b8dab
--- /dev/null
+++ b/src/native/public/mono/metadata/details/class-types.h
@@ -0,0 +1,29 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_CLASS_TYPES_H
+#define _MONO_CLASS_TYPES_H
+
+#include <mono/metadata/details/metadata-types.h>
+#include <mono/metadata/details/image-types.h>
+#include <mono/metadata/details/loader-types.h>
+#include <mono/utils/details/mono-error-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct MonoVTable MonoVTable;
+
+typedef struct _MonoClassField MonoClassField;
+typedef struct _MonoProperty MonoProperty;
+typedef struct _MonoEvent MonoEvent;
+
+typedef enum {
+	MONO_TYPE_NAME_FORMAT_IL,
+	MONO_TYPE_NAME_FORMAT_REFLECTION,
+	MONO_TYPE_NAME_FORMAT_FULL_NAME,
+	MONO_TYPE_NAME_FORMAT_ASSEMBLY_QUALIFIED
+} MonoTypeNameFormat;
+
+MONO_END_DECLS
+
+#endif /* _MONO_CLASS_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/debug-helpers-functions.h b/src/native/public/mono/metadata/details/debug-helpers-functions.h
new file mode 100644
index 00000000000000..522de330495f64
--- /dev/null
+++ b/src/native/public/mono/metadata/details/debug-helpers-functions.h
@@ -0,0 +1,32 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API char*, mono_disasm_code_one, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte** endp))
+MONO_API_FUNCTION(MONO_API char*, mono_disasm_code, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte* end))
+
+MONO_API_FUNCTION(MONO_API char*, mono_type_full_name, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API char*, mono_signature_get_desc, (MonoMethodSignature *sig, mono_bool include_namespace))
+
+MONO_API_FUNCTION(MONO_API char*, mono_context_get_desc, (MonoGenericContext *context))
+
+MONO_API_FUNCTION(MONO_API MonoMethodDesc*, mono_method_desc_new, (const char *name, mono_bool include_namespace))
+MONO_API_FUNCTION(MONO_API MonoMethodDesc*, mono_method_desc_from_method, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_API void, mono_method_desc_free, (MonoMethodDesc *desc))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_method_desc_match, (MonoMethodDesc *desc, MonoMethod *method))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_method_desc_is_full, (MonoMethodDesc *desc))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_method_desc_full_match, (MonoMethodDesc *desc, MonoMethod *method))
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_method_desc_search_in_class, (MonoMethodDesc *desc, MonoClass *klass))
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_method_desc_search_in_image, (MonoMethodDesc *desc, MonoImage *image))
+
+MONO_API_FUNCTION(MONO_API char*, mono_method_full_name, (MonoMethod *method, mono_bool signature))
+MONO_API_FUNCTION(MONO_API char*, mono_method_get_reflection_name, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API char*, mono_field_full_name, (MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_debugger_agent_unhandled_exception, (MonoException *e))
diff --git a/src/native/public/mono/metadata/details/debug-helpers-types.h b/src/native/public/mono/metadata/details/debug-helpers-types.h
new file mode 100644
index 00000000000000..ee731818f3978b
--- /dev/null
+++ b/src/native/public/mono/metadata/details/debug-helpers-types.h
@@ -0,0 +1,29 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_DEBUG_HELPERS_TYPES_H
+#define _MONO_DEBUG_HELPERS_TYPES_H
+
+#include <mono/metadata/details/class-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct MonoDisHelper MonoDisHelper;
+
+typedef char* (*MonoDisIndenter) (MonoDisHelper *dh, MonoMethod *method, uint32_t ip_offset);
+typedef char* (*MonoDisTokener)  (MonoDisHelper *dh, MonoMethod *method, uint32_t token);
+
+struct MonoDisHelper {
+	const char *newline;
+	const char *label_format;
+	const char *label_target;
+	MonoDisIndenter indenter;
+	MonoDisTokener  tokener;
+	void* user_data;
+};
+
+typedef struct MonoMethodDesc MonoMethodDesc;
+
+MONO_END_DECLS
+
+#endif /* _MONO_DEBUG_HELPERS_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/environment-functions.h b/src/native/public/mono/metadata/details/environment-functions.h
new file mode 100644
index 00000000000000..14ad0b797243ee
--- /dev/null
+++ b/src/native/public/mono/metadata/details/environment-functions.h
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_environment_exitcode_get, (void))
+MONO_API_FUNCTION(MONO_API void, mono_environment_exitcode_set, (int32_t value))
+
+
diff --git a/src/native/public/mono/metadata/details/exception-functions.h b/src/native/public/mono/metadata/details/exception-functions.h
new file mode 100644
index 00000000000000..d16a3ff613c75c
--- /dev/null
+++ b/src/native/public/mono/metadata/details/exception-functions.h
@@ -0,0 +1,100 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_name, (MonoImage *image, const char* name_space, const char *name))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_token, (MonoImage *image, uint32_t token))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_name_two_strings, (MonoImage *image, const char *name_space, const char *name, MonoString *a1, MonoString *a2))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_name_msg, (MonoImage *image, const char *name_space, const char *name, const char *msg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_token_two_strings, (MonoImage *image, uint32_t token, MonoString *a1, MonoString *a2))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_name_domain, (MonoDomain *domain, MonoImage *image, const char* name_space, const char *name))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_divide_by_zero, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_security, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_arithmetic, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_overflow, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_null_reference, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_execution_engine, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_thread_abort, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_state, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_interrupted, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_serialization, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_invalid_cast, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_invalid_operation, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_index_out_of_range, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_array_type_mismatch, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_type_load, (MonoString *class_name, char *assembly_name))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_method, (const char *class_name, const char *member_name))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_field, (const char *class_name, const char *member_name))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_not_implemented, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_not_supported, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException*, mono_get_exception_argument_null, (const char *arg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_argument, (const char *arg, const char *msg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_argument_out_of_range, (const char *arg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_io, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found, (MonoString *fname))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found2, (const char *msg, MonoString *fname))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_type_initialization, (const char *type_name, MonoException *inner))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_synchronization_lock, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_cannot_unload_appdomain, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_appdomain_unloaded, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_bad_image_format, (const char *msg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_bad_image_format2, (const char *msg, MonoString *fname))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_stack_overflow, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_out_of_memory, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_field_access, (void))
+
+MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_method_access, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_reflection_type_load, (MonoArray *types, MonoArray *exceptions))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_runtime_wrapped, (MonoObject *wrapped_exception))
+
+/* Installs a function which is called when the runtime encounters an unhandled exception.
+ * This hook isn't expected to return.
+ * If no hook has been installed, the runtime will print a message before aborting.
+ */
+MONO_API_FUNCTION(MONO_API void, mono_install_unhandled_exception_hook, (MonoUnhandledExceptionFunc func, void *user_data))
+
diff --git a/src/native/public/mono/metadata/details/exception-types.h b/src/native/public/mono/metadata/details/exception-types.h
new file mode 100644
index 00000000000000..640bc953f45852
--- /dev/null
+++ b/src/native/public/mono/metadata/details/exception-types.h
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_EXCEPTION_TYPES_H
+#define _MONO_EXCEPTION_TYPES_H
+
+#include <mono/metadata/object-forward.h>
+#include <mono/metadata/details/object-types.h>
+#include <mono/metadata/details/image-types.h>
+
+
+MONO_BEGIN_DECLS
+
+typedef void  (*MonoUnhandledExceptionFunc)         (MonoObject *exc, void *user_data);
+
+MONO_END_DECLS
+
+#endif /* _MONO_EXCEPTION_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/image-functions.h b/src/native/public/mono/metadata/details/image-functions.h
new file mode 100644
index 00000000000000..f7d0c54101f540
--- /dev/null
+++ b/src/native/public/mono/metadata/details/image-functions.h
@@ -0,0 +1,57 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_images_init, (void))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_images_cleanup, (void))
+
+MONO_API_FUNCTION(MONO_API MonoImage *, mono_image_open, (const char *fname, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_full, (const char *fname, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_pe_file_open, (const char *fname, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data,  (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_full, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_with_name, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly, const char *name))
+MONO_API_FUNCTION(MONO_API void, mono_image_fixup_vtable, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded, (const char *name))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_full, (const char *name, mono_bool refonly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid, (const char *guid))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid_full, (const char *guid, mono_bool refonly))
+MONO_API_FUNCTION(MONO_API void, mono_image_init, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API void, mono_image_close, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API void, mono_image_addref, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API const char *, mono_image_strerror, (MonoImageOpenStatus status))
+
+MONO_API_FUNCTION(MONO_API int, mono_image_ensure_section, (MonoImage *image, const char *section))
+MONO_API_FUNCTION(MONO_API int, mono_image_ensure_section_idx, (MonoImage *image, int section))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_image_get_entry_point, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API const char *, mono_image_get_resource, (MonoImage *image, uint32_t offset, uint32_t *size))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_file_for_image, (MonoImage *image, int fileidx))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_module, (MonoImage *image, int idx))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_image_get_name, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API const char*, mono_image_get_filename, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API const char*, mono_image_get_guid, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API MonoAssembly*, mono_image_get_assembly, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_image_is_dynamic, (MonoImage *image))
+MONO_API_FUNCTION(MONO_API char*, mono_image_rva_map, (MonoImage *image, uint32_t rva))
+
+MONO_API_FUNCTION(MONO_API const MonoTableInfo *, mono_image_get_table_info, (MonoImage *image, int table_id))
+MONO_API_FUNCTION(MONO_API int, mono_image_get_table_rows, (MonoImage *image, int table_id))
+MONO_API_FUNCTION(MONO_API int, mono_table_info_get_rows, (const MonoTableInfo *table))
+
+/* This actually returns a MonoPEResourceDataEntry *, but declaring it
+ * causes an include file loop.
+ */
+MONO_API_FUNCTION(MONO_API void*, mono_image_lookup_resource, (MonoImage *image, uint32_t res_id, uint32_t lang_id, mono_unichar2 *name))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_image_get_public_key, (MonoImage *image, uint32_t *size))
+MONO_API_FUNCTION(MONO_API const char*, mono_image_get_strong_name, (MonoImage *image, uint32_t *size))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_image_strong_name_position, (MonoImage *image, uint32_t *size))
+MONO_API_FUNCTION(MONO_API void, mono_image_add_to_name_cache, (MonoImage *image, const char *nspace, const char *name, uint32_t idx))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_image_has_authenticode_entry, (MonoImage *image))
diff --git a/src/native/public/mono/metadata/details/image-types.h b/src/native/public/mono/metadata/details/image-types.h
new file mode 100644
index 00000000000000..133219b0d1e070
--- /dev/null
+++ b/src/native/public/mono/metadata/details/image-types.h
@@ -0,0 +1,28 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_IMAGE_TYPES_H
+#define _MONO_IMAGE_TYPES_H
+
+#include <stdio.h>
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/utils/details/mono-error-types.h>
+#include <mono/metadata/object-forward.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct _MonoAssembly MonoAssembly;
+typedef struct _MonoAssemblyName MonoAssemblyName;
+typedef struct _MonoTableInfo MonoTableInfo;
+
+typedef enum {
+	MONO_IMAGE_OK,
+	MONO_IMAGE_ERROR_ERRNO,
+	MONO_IMAGE_MISSING_ASSEMBLYREF,
+	MONO_IMAGE_IMAGE_INVALID
+} MonoImageOpenStatus;
+
+
+MONO_END_DECLS
+
+#endif /* _MONO_IMAGE_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/loader-functions.h b/src/native/public/mono/metadata/details/loader-functions.h
new file mode 100644
index 00000000000000..2ef1da13c23a42
--- /dev/null
+++ b/src/native/public/mono/metadata/details/loader-functions.h
@@ -0,0 +1,66 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method, (MonoImage *image, uint32_t token, MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_full, (MonoImage *image, uint32_t token, MonoClass *klass, MonoGenericContext *context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_constrained, (MonoImage *image, uint32_t token, MonoClass *constrained_class, MonoGenericContext *context, MonoMethod **cil_method))
+
+MONO_API_FUNCTION(MONO_API void, mono_free_method, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature_full, (MonoMethod *method, MonoImage *image, uint32_t token, MonoGenericContext *context))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature, (MonoMethod *method, MonoImage *image, uint32_t token))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_signature, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodHeader*, mono_method_get_header, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_method_get_name, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_method_get_class, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_token, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_flags, (MonoMethod *method, uint32_t *iflags))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_index, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_add_internal_call, (const char *name, const void* method))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_dangerous_add_raw_internal_call, (const char *name, const void* method))
+
+MONO_API_FUNCTION(MONO_API void*, mono_lookup_internal_call, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_lookup_icall_symbol, (MonoMethod *m))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_dllmap_insert, (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_lookup_pinvoke_call, (MonoMethod *method, const char **exc_class, const char **exc_arg))
+
+MONO_API_FUNCTION(MONO_API void, mono_method_get_param_names, (MonoMethod *method, const char **names))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_param_token, (MonoMethod *method, int idx))
+
+MONO_API_FUNCTION(MONO_API void, mono_method_get_marshal_info, (MonoMethod *method, MonoMarshalSpec **mspecs))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_method_has_marshal_info, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MonoMethod*, mono_method_get_last_managed, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_stack_walk, (MonoStackWalk func, void* user_data))
+
+/* Use this if the IL offset is not needed: it's faster */
+MONO_API_FUNCTION(MONO_API void, mono_stack_walk_no_il, (MonoStackWalk func, void* user_data))
+
+MONO_API_FUNCTION(MONO_API void, mono_stack_walk_async_safe, (MonoStackWalkAsyncSafe func, void *initial_sig_context, void* user_data))
+
+MONO_API_FUNCTION(MONO_API MonoMethodHeader*, mono_method_get_header_checked, (MonoMethod *method, MonoError *error))
+
+
diff --git a/src/native/public/mono/metadata/details/loader-types.h b/src/native/public/mono/metadata/details/loader-types.h
new file mode 100644
index 00000000000000..9e266d4e364cb0
--- /dev/null
+++ b/src/native/public/mono/metadata/details/loader-types.h
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_LOADER_TYPES_H
+#define _MONO_LOADER_TYPES_H
+
+#include <mono/utils/mono-forward.h>
+#include <mono/metadata/details/metadata-types.h>
+#include <mono/metadata/details/image-types.h>
+#include <mono/utils/details/mono-error-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef mono_bool (*MonoStackWalk)     (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data);
+
+typedef mono_bool (*MonoStackWalkAsyncSafe)     (MonoMethod *method, MonoDomain *domain, void *base_address, int offset, void* data);
+
+MONO_END_DECLS
+
+#endif /* _MONO_LOADER_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/metadata-functions.h b/src/native/public/mono/metadata/details/metadata-functions.h
new file mode 100644
index 00000000000000..77a4234eaf4f54
--- /dev/null
+++ b/src/native/public/mono/metadata/details/metadata-functions.h
@@ -0,0 +1,159 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+
+MONO_API_FUNCTION(MONO_API void, mono_metadata_init, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_metadata_decode_row, (const MonoTableInfo *t, int idx, uint32_t *res, int res_size))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_row_col, (const MonoTableInfo *t, int idx, unsigned int col))
+
+MONO_API_FUNCTION(MONO_API int, mono_metadata_compute_size, (MonoImage *meta, int tableindex, uint32_t *result_bitfield))
+
+/*
+ *
+ */
+MONO_API_FUNCTION(MONO_API const char *, mono_metadata_locate, (MonoImage *meta, int table, int idx))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char *, mono_metadata_locate_token, (MonoImage *meta, uint32_t token))
+
+MONO_API_FUNCTION(MONO_API const char *, mono_metadata_string_heap, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(MONO_API const char *, mono_metadata_blob_heap, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(MONO_API const char *, mono_metadata_user_string, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(MONO_API const char *, mono_metadata_guid_heap, (MonoImage *meta, uint32_t table_index))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_typedef_from_field, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_typedef_from_method, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_nested_in_typedef, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_nesting_typedef, (MonoImage *meta, uint32_t table_index, uint32_t start_index))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass**, mono_metadata_interfaces_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *count))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_events_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end_idx))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_methods_from_event, (MonoImage *meta, uint32_t table_index, unsigned int *end))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_properties_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_methods_from_property, (MonoImage *meta, uint32_t table_index, unsigned int *end))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_packing_from_typedef, (MonoImage *meta, uint32_t table_index, uint32_t *packing, uint32_t *size))
+MONO_API_FUNCTION(MONO_API const char*, mono_metadata_get_marshal_info, (MonoImage *meta, uint32_t idx, mono_bool is_field))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_custom_attrs_from_index, (MonoImage *meta, uint32_t cattr_index))
+
+MONO_API_FUNCTION(MONO_API MonoMarshalSpec *, mono_metadata_parse_marshal_spec, (MonoImage *image, const char *ptr))
+
+MONO_API_FUNCTION(MONO_API void, mono_metadata_free_marshal_spec, (MonoMarshalSpec *spec))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_implmap_from_method, (MonoImage *meta, uint32_t method_idx))
+
+MONO_API_FUNCTION(MONO_API void, mono_metadata_field_info, (MonoImage *meta, uint32_t table_index, uint32_t *offset, uint32_t *rva, MonoMarshalSpec **marshal_spec))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_get_constant_index, (MonoImage *meta, uint32_t token, uint32_t hint))
+
+/*
+ * Functions to extract information from the Blobs
+ */
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_value, (const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API int32_t, mono_metadata_decode_signed_value, (const char *ptr, const char **rptr))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_blob_size, (const char *ptr, const char **rptr))
+
+MONO_API_FUNCTION(MONO_API void, mono_metadata_encode_value, (uint32_t value, char *bug, char **endbuf))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_type_is_byref, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_type_get_type, (MonoType *type))
+
+/* For MONO_TYPE_FNPTR */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_type_get_signature, (MonoType *type))
+
+/* For MONO_TYPE_CLASS, VALUETYPE */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_type_get_class, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API MonoArrayType*, mono_type_get_array_type, (MonoType *type))
+
+/* For MONO_TYPE_PTR */
+MONO_API_FUNCTION(MONO_API MonoType*, mono_type_get_ptr_type, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API MonoClass*, mono_type_get_modifiers, (MonoType *type, mono_bool *is_required, void **iter))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_struct, (MonoType *type))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_void, (MonoType *type))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_pointer, (MonoType *type))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_reference, (MonoType *type))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_generic_parameter, (MonoType *type))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_return_type, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_params, (MonoMethodSignature *sig, void **iter))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_signature_get_param_count, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_signature_get_call_conv, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API int, mono_signature_vararg_start, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_signature_is_instance, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_signature_explicit_this, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_signature_param_is_out, (MonoMethodSignature *sig, int param_num))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_parse_typedef_or_ref, (MonoImage *m, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API int, mono_metadata_parse_custom_mod, (MonoImage *m, MonoCustomMod *dest, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArrayType *, mono_metadata_parse_array, (MonoImage *m, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API void, mono_metadata_free_array, (MonoArrayType     *array))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_type, (MonoImage *m, MonoParseTypeMode mode, short opt_attrs, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_param, (MonoImage *m, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_field_type, (MonoImage *m, short field_flags, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_type_create_from_typespec, (MonoImage *image, uint32_t type_spec))
+MONO_API_FUNCTION(MONO_API void, mono_metadata_free_type, (MonoType *type))
+MONO_API_FUNCTION(MONO_API int, mono_type_size, (MonoType *type, int *alignment))
+MONO_API_FUNCTION(MONO_API int, mono_type_stack_size, (MonoType *type, int *alignment))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_type_generic_inst_is_valuetype, (MonoType *type))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_metadata_generic_class_is_valuetype, (MonoGenericClass *gclass))
+
+MONO_API_FUNCTION(MONO_API unsigned int, mono_metadata_type_hash, (MonoType *t1))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_metadata_type_equal, (MonoType *t1, MonoType *t2))
+
+MONO_API_FUNCTION(MONO_API MonoMethodSignature *, mono_metadata_signature_alloc, (MonoImage *image, uint32_t nparams))
+
+MONO_API_FUNCTION(MONO_API MonoMethodSignature *, mono_metadata_signature_dup, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_signature, (MonoImage *image, uint32_t token))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_method_signature, (MonoImage *m, int def, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_API void, mono_metadata_free_method_signature, (MonoMethodSignature *method))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_metadata_signature_equal, (MonoMethodSignature *sig1, MonoMethodSignature *sig2))
+
+MONO_API_FUNCTION(MONO_API unsigned int, mono_signature_hash, (MonoMethodSignature *sig))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodHeader *, mono_metadata_parse_mh, (MonoImage *m, const char *ptr))
+MONO_API_FUNCTION(MONO_API void, mono_metadata_free_mh, (MonoMethodHeader *mh))
+
+/* MonoMethodHeader accessors */
+MONO_API_FUNCTION(MONO_API const unsigned char*, mono_method_header_get_code, (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack))
+
+MONO_API_FUNCTION(MONO_API MonoType**, mono_method_header_get_locals, (MonoMethodHeader *header, uint32_t* num_locals, mono_bool *init_locals))
+
+MONO_API_FUNCTION(MONO_API int, mono_method_header_get_num_clauses, (MonoMethodHeader *header))
+
+MONO_API_FUNCTION(MONO_API int, mono_method_header_get_clauses, (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_type_to_unmanaged, (MonoType *type, MonoMarshalSpec *mspec, mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_token_from_dor, (uint32_t dor_index))
+
+MONO_API_FUNCTION(MONO_API char *, mono_guid_to_string, (const uint8_t *guid))
+
+MONO_API_FUNCTION(MONO_API char *, mono_guid_to_string_minimal, (const uint8_t *guid))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_declsec_from_index, (MonoImage *meta, uint32_t idx))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_translate_token_index, (MonoImage *image, int table, uint32_t idx))
+
+MONO_API_FUNCTION(MONO_API void, mono_metadata_decode_table_row, (MonoImage *image, int table, int idx, uint32_t *res, int res_size))
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_table_row_col, (MonoImage *image, int table, int idx, unsigned int col))
diff --git a/src/native/public/mono/metadata/details/metadata-types.h b/src/native/public/mono/metadata/details/metadata-types.h
new file mode 100644
index 00000000000000..917228fc108a47
--- /dev/null
+++ b/src/native/public/mono/metadata/details/metadata-types.h
@@ -0,0 +1,257 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_METADATA_TYPES_H
+#define _MONO_METADATA_TYPES_H
+
+
+#include <mono/utils/details/mono-publib-types.h>
+
+#include <mono/utils/mono-forward.h>
+#include <mono/metadata/blob.h>
+#include <mono/metadata/row-indexes.h>
+#include <mono/metadata/details/image-types.h>
+#include <mono/metadata/object-forward.h>
+
+MONO_BEGIN_DECLS
+
+typedef enum {
+	MONO_EXCEPTION_CLAUSE_NONE,
+	MONO_EXCEPTION_CLAUSE_FILTER,
+	MONO_EXCEPTION_CLAUSE_FINALLY,
+	MONO_EXCEPTION_CLAUSE_FAULT = 4
+} MonoExceptionEnum;
+
+typedef enum {
+	MONO_CALL_DEFAULT,
+	MONO_CALL_C,
+	MONO_CALL_STDCALL,
+	MONO_CALL_THISCALL,
+	MONO_CALL_FASTCALL,
+	MONO_CALL_VARARG = 0x05,
+	/* unused, */
+	/* unused, */
+	/* unused, */
+	MONO_CALL_UNMANAGED_MD = 0x09, /* default unmanaged calling convention, with additional attributed encoded in modopts */
+} MonoCallConvention;
+
+/* ECMA lamespec: the old spec had more info... */
+typedef enum {
+	MONO_NATIVE_BOOLEAN = 0x02, /* 4 bytes, 0 is false, != 0 is true */
+	MONO_NATIVE_I1 = 0x03,
+	MONO_NATIVE_U1 = 0x04,
+	MONO_NATIVE_I2 = 0x05,
+	MONO_NATIVE_U2 = 0x06,
+	MONO_NATIVE_I4 = 0x07,
+	MONO_NATIVE_U4 = 0x08,
+	MONO_NATIVE_I8 = 0x09,
+	MONO_NATIVE_U8 = 0x0a,
+	MONO_NATIVE_R4 = 0x0b,
+	MONO_NATIVE_R8 = 0x0c,
+	MONO_NATIVE_CURRENCY = 0x0f,
+	MONO_NATIVE_BSTR = 0x13, /* prefixed length, Unicode */
+	MONO_NATIVE_LPSTR = 0x14, /* ANSI, null terminated */
+	MONO_NATIVE_LPWSTR = 0x15, /* UNICODE, null terminated */
+	MONO_NATIVE_LPTSTR = 0x16, /* plattform dep., null terminated */
+	MONO_NATIVE_BYVALTSTR = 0x17,
+	MONO_NATIVE_IUNKNOWN = 0x19,
+	MONO_NATIVE_IDISPATCH = 0x1a,
+	MONO_NATIVE_STRUCT = 0x1b,
+	MONO_NATIVE_INTERFACE = 0x1c,
+	MONO_NATIVE_SAFEARRAY = 0x1d,
+	MONO_NATIVE_BYVALARRAY = 0x1e,
+	MONO_NATIVE_INT   = 0x1f,
+	MONO_NATIVE_UINT  = 0x20,
+	MONO_NATIVE_VBBYREFSTR  = 0x22,
+	MONO_NATIVE_ANSIBSTR  = 0x23,  /* prefixed length, ANSI */
+	MONO_NATIVE_TBSTR  = 0x24, /* prefixed length, plattform dep. */
+	MONO_NATIVE_VARIANTBOOL  = 0x25,
+	MONO_NATIVE_FUNC  = 0x26,
+	MONO_NATIVE_ASANY = 0x28,
+	MONO_NATIVE_LPARRAY = 0x2a,
+	MONO_NATIVE_LPSTRUCT = 0x2b,
+	MONO_NATIVE_CUSTOM = 0x2c,
+	MONO_NATIVE_ERROR = 0x2d,
+	// TODO: MONO_NATIVE_IINSPECTABLE = 0x2e
+	// TODO: MONO_NATIVE_HSTRING = 0x2f
+	MONO_NATIVE_UTF8STR = 0x30,
+	MONO_NATIVE_MAX = 0x50 /* no info */
+} MonoMarshalNative;
+
+/* Used only in context of SafeArray */
+typedef enum {
+	MONO_VARIANT_EMPTY = 0x00,
+	MONO_VARIANT_NULL = 0x01,
+	MONO_VARIANT_I2 = 0x02,
+	MONO_VARIANT_I4 = 0x03,
+	MONO_VARIANT_R4 = 0x04,
+	MONO_VARIANT_R8 = 0x05,
+	MONO_VARIANT_CY = 0x06,
+	MONO_VARIANT_DATE = 0x07,
+	MONO_VARIANT_BSTR = 0x08,
+	MONO_VARIANT_DISPATCH = 0x09,
+	MONO_VARIANT_ERROR = 0x0a,
+	MONO_VARIANT_BOOL = 0x0b,
+	MONO_VARIANT_VARIANT = 0x0c,
+	MONO_VARIANT_UNKNOWN = 0x0d,
+	MONO_VARIANT_DECIMAL = 0x0e,
+	MONO_VARIANT_I1 = 0x10,
+	MONO_VARIANT_UI1 = 0x11,
+	MONO_VARIANT_UI2 = 0x12,
+	MONO_VARIANT_UI4 = 0x13,
+	MONO_VARIANT_I8 = 0x14,
+	MONO_VARIANT_UI8 = 0x15,
+	MONO_VARIANT_INT = 0x16,
+	MONO_VARIANT_UINT = 0x17,
+	MONO_VARIANT_VOID = 0x18,
+	MONO_VARIANT_HRESULT = 0x19,
+	MONO_VARIANT_PTR = 0x1a,
+	MONO_VARIANT_SAFEARRAY = 0x1b,
+	MONO_VARIANT_CARRAY = 0x1c,
+	MONO_VARIANT_USERDEFINED = 0x1d,
+	MONO_VARIANT_LPSTR = 0x1e,
+	MONO_VARIANT_LPWSTR = 0x1f,
+	MONO_VARIANT_RECORD = 0x24,
+	MONO_VARIANT_FILETIME = 0x40,
+	MONO_VARIANT_BLOB = 0x41,
+	MONO_VARIANT_STREAM = 0x42,
+	MONO_VARIANT_STORAGE = 0x43,
+	MONO_VARIANT_STREAMED_OBJECT = 0x44,
+	MONO_VARIANT_STORED_OBJECT = 0x45,
+	MONO_VARIANT_BLOB_OBJECT = 0x46,
+	MONO_VARIANT_CF = 0x47,
+	MONO_VARIANT_CLSID = 0x48,
+	MONO_VARIANT_VECTOR = 0x1000,
+	MONO_VARIANT_ARRAY = 0x2000,
+	MONO_VARIANT_BYREF = 0x4000
+} MonoMarshalVariant;
+
+typedef enum {
+	MONO_MARSHAL_CONV_NONE,
+	MONO_MARSHAL_CONV_BOOL_VARIANTBOOL,
+	MONO_MARSHAL_CONV_BOOL_I4,
+	MONO_MARSHAL_CONV_STR_BSTR,
+	MONO_MARSHAL_CONV_STR_LPSTR,
+	MONO_MARSHAL_CONV_LPSTR_STR,
+	MONO_MARSHAL_CONV_LPTSTR_STR,
+	MONO_MARSHAL_CONV_STR_LPWSTR,
+	MONO_MARSHAL_CONV_LPWSTR_STR,
+	MONO_MARSHAL_CONV_STR_LPTSTR,
+	MONO_MARSHAL_CONV_STR_ANSIBSTR,
+	MONO_MARSHAL_CONV_STR_TBSTR,
+	MONO_MARSHAL_CONV_STR_BYVALSTR,
+	MONO_MARSHAL_CONV_STR_BYVALWSTR,
+	MONO_MARSHAL_CONV_SB_LPSTR,
+	MONO_MARSHAL_CONV_SB_LPTSTR,
+	MONO_MARSHAL_CONV_SB_LPWSTR,
+	MONO_MARSHAL_CONV_LPSTR_SB,
+	MONO_MARSHAL_CONV_LPTSTR_SB,
+	MONO_MARSHAL_CONV_LPWSTR_SB,
+	MONO_MARSHAL_CONV_ARRAY_BYVALARRAY,
+	MONO_MARSHAL_CONV_ARRAY_BYVALCHARARRAY,
+	MONO_MARSHAL_CONV_ARRAY_SAVEARRAY,
+	MONO_MARSHAL_CONV_ARRAY_LPARRAY,
+	MONO_MARSHAL_FREE_LPARRAY,
+	MONO_MARSHAL_CONV_OBJECT_INTERFACE,
+	MONO_MARSHAL_CONV_OBJECT_IDISPATCH,
+	MONO_MARSHAL_CONV_OBJECT_IUNKNOWN,
+	MONO_MARSHAL_CONV_OBJECT_STRUCT,
+	MONO_MARSHAL_CONV_DEL_FTN,
+	MONO_MARSHAL_CONV_FTN_DEL,
+	MONO_MARSHAL_FREE_ARRAY,
+	MONO_MARSHAL_CONV_BSTR_STR,
+	MONO_MARSHAL_CONV_SAFEHANDLE,
+	MONO_MARSHAL_CONV_HANDLEREF,
+	MONO_MARSHAL_CONV_STR_UTF8STR,
+	MONO_MARSHAL_CONV_SB_UTF8STR,
+	MONO_MARSHAL_CONV_UTF8STR_STR,
+	MONO_MARSHAL_CONV_UTF8STR_SB,
+	MONO_MARSHAL_CONV_FIXED_BUFFER,
+	MONO_MARSHAL_CONV_ANSIBSTR_STR,
+	MONO_MARSHAL_CONV_TBSTR_STR
+} MonoMarshalConv;
+
+#define MONO_MARSHAL_CONV_INVALID ((MonoMarshalConv)-1)
+
+typedef struct {
+	MonoMarshalNative native;
+	union {
+		struct {
+			MonoMarshalNative elem_type;
+			int32_t num_elem; /* -1 if not set */
+			int16_t param_num; /* -1 if not set */
+			int16_t elem_mult; /* -1 if not set */
+		} array_data;
+		struct {
+			char *custom_name;
+			char *cookie;
+			MonoImage *image;
+		} custom_data;
+		struct {
+			MonoMarshalVariant elem_type;
+			int32_t num_elem;
+		} safearray_data;
+	} data;
+} MonoMarshalSpec;
+
+typedef struct {
+	uint32_t flags;
+	uint32_t try_offset;
+	uint32_t try_len;
+	uint32_t handler_offset;
+	uint32_t handler_len;
+	union {
+		uint32_t filter_offset;
+		MonoClass *catch_class;
+	} data;
+} MonoExceptionClause;
+
+typedef struct _MonoType MonoType;
+typedef struct _MonoGenericInst MonoGenericInst;
+typedef struct _MonoGenericClass MonoGenericClass;
+typedef struct _MonoGenericContext MonoGenericContext;
+typedef struct _MonoGenericContainer MonoGenericContainer;
+typedef struct _MonoGenericParam MonoGenericParam;
+typedef struct _MonoArrayType MonoArrayType;
+typedef struct _MonoMethodSignature MonoMethodSignature;
+
+/* FIXME: Keeping this name alive for now, since it is part of the exposed API, even though no entrypoint uses it.  */
+typedef struct invalid_name MonoGenericMethod;
+
+typedef struct {
+	unsigned int required : 1;
+	unsigned int token    : 31;
+} MonoCustomMod;
+
+typedef struct _MonoCustomModContainer {
+	uint8_t count; /* max 64 modifiers follow at the end */
+	MonoImage *image; /* Image containing types in modifiers array */
+	MonoCustomMod modifiers [1]; /* Actual length is count */
+} MonoCustomModContainer;
+
+struct _MonoArrayType {
+	MonoClass *eklass;
+	// Number of dimensions of the array
+	uint8_t rank;
+
+	// Arrays recording known upper and lower index bounds for each dimension
+	uint8_t numsizes;
+	uint8_t numlobounds;
+	int *sizes;
+	int *lobounds;
+};
+
+typedef struct _MonoMethodHeader MonoMethodHeader;
+
+typedef enum {
+	MONO_PARSE_TYPE,
+	MONO_PARSE_MOD_TYPE,
+	MONO_PARSE_LOCAL,
+	MONO_PARSE_PARAM,
+	MONO_PARSE_RET,
+	MONO_PARSE_FIELD
+} MonoParseTypeMode;
+
+MONO_END_DECLS
+
+#endif /* _MONO_METADATA_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/mono-config-functions.h b/src/native/public/mono/metadata/details/mono-config-functions.h
new file mode 100644
index 00000000000000..49108de4d7bd11
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-config-functions.h
@@ -0,0 +1,28 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API const char *, mono_config_get_os, (void))
+MONO_API_FUNCTION(MONO_API const char *, mono_config_get_cpu, (void))
+MONO_API_FUNCTION(MONO_API const char *, mono_config_get_wordsize, (void))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_get_config_dir, (void))
+MONO_API_FUNCTION(MONO_API void, mono_set_config_dir, (const char *dir))
+
+MONO_API_FUNCTION(MONO_API const char *, mono_get_machine_config, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_config_cleanup, (void))
+MONO_API_FUNCTION(MONO_API void, mono_config_parse, (const char *filename))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_config_for_assembly, (MonoImage *assembly))
+MONO_API_FUNCTION(MONO_API void, mono_config_parse_memory, (const char *buffer))
+
+MONO_API_FUNCTION(MONO_API const char*, mono_config_string_for_assembly_file, (const char *filename))
+
+MONO_API_FUNCTION(MONO_API void, mono_config_set_server_mode, (mono_bool server_mode))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_config_is_server_mode, (void))
+
+
diff --git a/src/native/public/mono/metadata/details/mono-config-types.h b/src/native/public/mono/metadata/details/mono-config-types.h
new file mode 100644
index 00000000000000..1832f5bff41df8
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-config-types.h
@@ -0,0 +1,14 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_METADATA_CONFIG_TYPES_H
+#define _MONO_METADATA_CONFIG_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/metadata/details/image-types.h>
+
+MONO_BEGIN_DECLS
+
+MONO_END_DECLS
+
+#endif /* _MONO_METADATA_CONFIG_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/mono-debug-functions.h b/src/native/public/mono/metadata/details/mono-debug-functions.h
new file mode 100644
index 00000000000000..427a4b30e4019c
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-debug-functions.h
@@ -0,0 +1,66 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_debug_enabled, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_debug_init, (MonoDebugFormat format))
+MONO_API_FUNCTION(MONO_API void, mono_debug_open_image_from_memory, (MonoImage *image, const mono_byte *raw_contents, int size))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_debug_cleanup, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_debug_close_image, (MonoImage *image))
+
+MONO_API_FUNCTION(MONO_API void, mono_debug_domain_unload, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_API void, mono_debug_domain_create, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MonoDebugMethodAddress *, mono_debug_add_method, (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API void, mono_debug_remove_method, (MonoMethod *method, MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MonoDebugMethodInfo *, mono_debug_lookup_method, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MonoDebugMethodAddressList *, mono_debug_lookup_method_addresses, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MonoDebugMethodJitInfo*, mono_debug_find_method, (MonoMethod *method, MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MonoDebugHandle *, mono_debug_get_handle, (MonoImage *image))
+
+MONO_API_FUNCTION(MONO_API void, mono_debug_free_method_jit_info, (MonoDebugMethodJitInfo *jit))
+
+
+MONO_API_FUNCTION(MONO_API void, mono_debug_add_delegate_trampoline, (void* code, int size))
+
+MONO_API_FUNCTION(MONO_API MonoDebugLocalsInfo*, mono_debug_lookup_locals, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MonoDebugMethodAsyncInfo*, mono_debug_lookup_method_async_debug_info, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MonoDebugSourceLocation *, mono_debug_method_lookup_location, (MonoDebugMethodInfo *minfo, int il_offset))
+
+/*
+ * Line number support.
+ */
+
+MONO_API_FUNCTION(MONO_API MonoDebugSourceLocation *, mono_debug_lookup_source_location, (MonoMethod *method, uint32_t address, MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API int32_t, mono_debug_il_offset_from_address, (MonoMethod *method, MonoDomain *domain, uint32_t native_offset))
+
+MONO_API_FUNCTION(MONO_API void, mono_debug_free_source_location, (MonoDebugSourceLocation *location))
+
+MONO_API_FUNCTION(MONO_API char *, mono_debug_print_stack_frame, (MonoMethod *method, uint32_t native_offset, MonoDomain *domain))
+
+/*
+ * Mono Debugger support functions
+ *
+ * These methods are used by the JIT while running inside the Mono Debugger.
+ */
+
+MONO_API_FUNCTION(MONO_API int, mono_debugger_method_has_breakpoint, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_API int, mono_debugger_insert_breakpoint, (const char *method_name, mono_bool include_namespace))
+
+MONO_API_FUNCTION(MONO_API void, mono_set_is_debugger_attached, (mono_bool attached))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_is_debugger_attached, (void))
+
diff --git a/src/native/public/mono/metadata/details/mono-debug-types.h b/src/native/public/mono/metadata/details/mono-debug-types.h
new file mode 100644
index 00000000000000..197ec408168307
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-debug-types.h
@@ -0,0 +1,154 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_MONO_DEBUG_TYPES_H
+#define _MONO_MONO_DEBUG_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/metadata/details/image-types.h>
+#include <mono/metadata/details/appdomain-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct _MonoSymbolTable			MonoSymbolTable;
+typedef struct _MonoDebugDataTable		MonoDebugDataTable;
+
+typedef struct _MonoSymbolFile			MonoSymbolFile;
+typedef struct _MonoPPDBFile			MonoPPDBFile;
+
+typedef struct _MonoDebugHandle			MonoDebugHandle;
+
+typedef struct _MonoDebugLineNumberEntry	MonoDebugLineNumberEntry;
+
+typedef struct _MonoDebugVarInfo		MonoDebugVarInfo;
+typedef struct _MonoDebugMethodJitInfo		MonoDebugMethodJitInfo;
+typedef struct _MonoDebugMethodAddress		MonoDebugMethodAddress;
+typedef struct _MonoDebugMethodAddressList	MonoDebugMethodAddressList;
+typedef struct _MonoDebugClassEntry		MonoDebugClassEntry;
+
+typedef struct _MonoDebugMethodInfo		MonoDebugMethodInfo;
+typedef struct _MonoDebugLocalsInfo		MonoDebugLocalsInfo;
+typedef struct _MonoDebugMethodAsyncInfo	MonoDebugMethodAsyncInfo;
+typedef struct _MonoDebugSourceLocation		MonoDebugSourceLocation;
+
+typedef struct _MonoDebugList			MonoDebugList;
+
+typedef enum {
+	MONO_DEBUG_FORMAT_NONE,
+	MONO_DEBUG_FORMAT_MONO,
+	/* Deprecated, the mdb debugger is not longer supported. */
+	MONO_DEBUG_FORMAT_DEBUGGER
+} MonoDebugFormat;
+
+/*
+ * NOTE:
+ * We intentionally do not use GList here since the debugger needs to know about
+ * the layout of the fields.
+*/
+struct _MonoDebugList {
+	MonoDebugList *next;
+	const void* data;
+};
+
+struct _MonoSymbolTable {
+	uint64_t magic;
+	uint32_t version;
+	uint32_t total_size;
+
+	/*
+	 * Corlib and metadata info.
+	 */
+	MonoDebugHandle *corlib;
+	MonoDebugDataTable *global_data_table;
+	MonoDebugList *data_tables;
+
+	/*
+	 * The symbol files.
+	 */
+	MonoDebugList *symbol_files;
+};
+
+struct _MonoDebugHandle {
+	uint32_t index;
+	char *image_file;
+	MonoImage *image;
+	MonoDebugDataTable *type_table;
+	MonoSymbolFile *symfile;
+	MonoPPDBFile *ppdb;
+};
+
+struct _MonoDebugMethodJitInfo {
+	const mono_byte *code_start;
+	uint32_t code_size;
+	uint32_t prologue_end;
+	uint32_t epilogue_begin;
+	const mono_byte *wrapper_addr;
+	uint32_t num_line_numbers;
+	MonoDebugLineNumberEntry *line_numbers;
+	uint32_t has_var_info;
+	uint32_t num_params;
+	MonoDebugVarInfo *this_var;
+	MonoDebugVarInfo *params;
+	uint32_t num_locals;
+	MonoDebugVarInfo *locals;
+	MonoDebugVarInfo *gsharedvt_info_var;
+	MonoDebugVarInfo *gsharedvt_locals_var;
+};
+
+struct _MonoDebugMethodAddressList {
+	uint32_t size;
+	uint32_t count;
+	mono_byte data [MONO_ZERO_LEN_ARRAY];
+};
+
+struct _MonoDebugSourceLocation {
+	char *source_file;
+	uint32_t row, column;
+	uint32_t il_offset;
+};
+
+/*
+ * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
+ * where the variable is actually stored.
+ *
+ * See relocate_variable() in debug-symfile.c for more info.
+ */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS		0xf0000000
+
+/* The variable is in register "index". */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER		0
+
+/* The variable is at offset "offset" from register "index". */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET		0x10000000
+
+/* The variable is in the two registers "offset" and "index". */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS	0x20000000
+
+/* The variable is dead. */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_DEAD		0x30000000
+
+/* Same as REGOFFSET, but do an indirection */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR		0x40000000
+
+/* gsharedvt local */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL		0x50000000
+
+/* variable is a vt address */
+#define MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR		0x60000000
+
+struct _MonoDebugVarInfo {
+	uint32_t index;
+	uint32_t offset;
+	uint32_t size;
+	uint32_t begin_scope;
+	uint32_t end_scope;
+	MonoType *type;
+};
+
+#define MONO_DEBUGGER_MAJOR_VERSION			81
+#define MONO_DEBUGGER_MINOR_VERSION			6
+#define MONO_DEBUGGER_MAGIC				0x7aff65af4253d427ULL
+
+MONO_END_DECLS
+
+#endif /* _MONO_MONO_DEBUG_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/mono-gc-functions.h b/src/native/public/mono/metadata/details/mono-gc-functions.h
new file mode 100644
index 00000000000000..0881c8e18e4273
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-gc-functions.h
@@ -0,0 +1,23 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_gc_collect, (int generation))
+MONO_API_FUNCTION(MONO_API int, mono_gc_max_generation, (void))
+MONO_API_FUNCTION(MONO_API int, mono_gc_get_generation, (MonoObject *object))
+MONO_API_FUNCTION(MONO_API int, mono_gc_collection_count, (int generation))
+MONO_API_FUNCTION(MONO_API int64_t, mono_gc_get_generation_size, (int generation))
+MONO_API_FUNCTION(MONO_API int64_t, mono_gc_get_used_size, (void))
+MONO_API_FUNCTION(MONO_API int64_t, mono_gc_get_heap_size, (void))
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_gc_pending_finalizers, (void))
+MONO_API_FUNCTION(MONO_API void, mono_gc_finalize_notify, (void))
+MONO_API_FUNCTION(MONO_API int, mono_gc_invoke_finalizers, (void))
+/* heap walking is only valid in the pre-stop-world event callback */
+MONO_API_FUNCTION(MONO_API int, mono_gc_walk_heap, (int flags, MonoGCReferences callback, void *data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_init_finalizer_thread, (void))
+
diff --git a/src/native/public/mono/metadata/details/mono-gc-types.h b/src/native/public/mono/metadata/details/mono-gc-types.h
new file mode 100644
index 00000000000000..16752103193959
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-gc-types.h
@@ -0,0 +1,114 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_METADATA_MONO_GC_TYPES_H
+#define _MONO_METADATA_MONO_GC_TYPES_H
+
+#include <mono/metadata/details/object-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef int (*MonoGCReferences) (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data);
+
+/**
+ * This enum is used by the profiler API when reporting root registration.
+ */
+typedef enum {
+	/**
+	 * Roots external to Mono. Embedders may only use this value.
+	 */
+	MONO_ROOT_SOURCE_EXTERNAL = 0,
+	/**
+	 * Thread call stack.
+	 *
+	 * The \c key parameter is a thread ID as a \c uintptr_t.
+	 */
+	MONO_ROOT_SOURCE_STACK = 1,
+	/**
+	 * Roots in the finalizer queue. This is a pseudo-root.
+	 */
+	MONO_ROOT_SOURCE_FINALIZER_QUEUE = 2,
+	/**
+	 * Managed \c static variables.
+	 *
+	 * The \c key parameter is a \c MonoVTable pointer.
+	 */
+	MONO_ROOT_SOURCE_STATIC = 3,
+	/**
+	 * Managed \c static variables with \c ThreadStaticAttribute.
+	 *
+	 * The \c key parameter is a thread ID as a \c uintptr_t.
+	 */
+	MONO_ROOT_SOURCE_THREAD_STATIC = 4,
+	/**
+	 * Managed \c static variables with \c ContextStaticAttribute.
+	 *
+	 * The \c key parameter is a \c MonoAppContext pointer.
+	 */
+	MONO_ROOT_SOURCE_CONTEXT_STATIC = 5,
+	/**
+	 * \c GCHandle structures.
+	 */
+	MONO_ROOT_SOURCE_GC_HANDLE = 6,
+	/**
+	 * Roots in the just-in-time compiler.
+	 */
+	MONO_ROOT_SOURCE_JIT = 7,
+	/**
+	 * Roots in the threading subsystem.
+	 *
+	 * The \c key parameter, if not \c NULL, is a thread ID as a \c uintptr_t.
+	 */
+	MONO_ROOT_SOURCE_THREADING = 8,
+	/**
+	 * Roots in application domains.
+	 *
+	 * The \c key parameter, if not \c NULL, is a \c MonoDomain pointer.
+	 */
+	MONO_ROOT_SOURCE_DOMAIN = 9,
+	/**
+	 * Roots in reflection code.
+	 *
+	 * The \c key parameter, if not \c NULL, is a \c MonoVTable pointer.
+	 */
+	MONO_ROOT_SOURCE_REFLECTION = 10,
+	/**
+	 * Roots from P/Invoke or other marshaling infrastructure.
+	 */
+	MONO_ROOT_SOURCE_MARSHAL = 11,
+	/**
+	 * Roots in the thread pool data structures.
+	 */
+	MONO_ROOT_SOURCE_THREAD_POOL = 12,
+	/**
+	 * Roots in the debugger agent.
+	 */
+	MONO_ROOT_SOURCE_DEBUGGER = 13,
+	/**
+	 * Roots in the runtime handle stack. This is a pseudo-root.
+	 *
+	 * The \c key parameter is a thread ID as a \c uintptr_t.
+	 */
+	MONO_ROOT_SOURCE_HANDLE = 14,
+	/**
+	 * Roots in the ephemeron arrays. This is a pseudo-root.
+	 */
+	MONO_ROOT_SOURCE_EPHEMERON = 15,
+	/**
+	 * Roots in the toggleref arrays. This is a pseudo-root.
+	 */
+	MONO_ROOT_SOURCE_TOGGLEREF = 16,
+} MonoGCRootSource;
+
+typedef enum {
+	MONO_GC_HANDLE_TYPE_MIN = 0,
+	MONO_GC_HANDLE_WEAK = MONO_GC_HANDLE_TYPE_MIN,
+	MONO_GC_HANDLE_WEAK_TRACK_RESURRECTION,
+	MONO_GC_HANDLE_NORMAL,
+	MONO_GC_HANDLE_PINNED,
+	MONO_GC_HANDLE_TYPE_MAX,
+} MonoGCHandleType;
+
+MONO_END_DECLS
+
+#endif /* _MONO_METADATA_MONO_GC_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/mono-private-unstable-functions.h b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
new file mode 100644
index 00000000000000..ac2a9bb24c10a1
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_load_full_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, const char *name))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook_v3, (MonoAssemblyPreLoadFuncV3 func, void *user_data, mono_bool append))
+
+// This can point at NULL before the default ALC is initialized
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssemblyLoadContextGCHandle, mono_alc_get_default_gchandle, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_register_bundled_satellite_assemblies, (const MonoBundledSatelliteAssembly **assemblies))
+
+MONO_API_FUNCTION(MONO_API MonoBundledSatelliteAssembly *, mono_create_new_bundled_satellite_assembly, (const char *name, const char *culture, const unsigned char *data, unsigned int size))
+
diff --git a/src/native/public/mono/metadata/details/mono-private-unstable-types.h b/src/native/public/mono/metadata/details/mono-private-unstable-types.h
new file mode 100644
index 00000000000000..efd133a64f5209
--- /dev/null
+++ b/src/native/public/mono/metadata/details/mono-private-unstable-types.h
@@ -0,0 +1,22 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H
+#define _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/utils/mono-forward.h>
+
+MONO_BEGIN_DECLS
+
+typedef MonoGCHandle MonoAssemblyLoadContextGCHandle;
+
+typedef MonoAssembly * (*MonoAssemblyPreLoadFuncV3) (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, char **assemblies_path, void *user_data, MonoError *error);
+
+typedef struct _MonoBundledSatelliteAssembly MonoBundledSatelliteAssembly;
+
+typedef void * (*PInvokeOverrideFn) (const char *libraryName, const char *entrypointName);
+
+MONO_END_DECLS
+
+#endif /* _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/object-functions.h b/src/native/public/mono/metadata/details/object-functions.h
new file mode 100644
index 00000000000000..38c5a74c5e02d4
--- /dev/null
+++ b/src/native/public/mono/metadata/details/object-functions.h
@@ -0,0 +1,224 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_chars, (MonoString *s))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_string_length, (MonoString *s))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new, (MonoDomain *domain, MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_specific, (MonoVTable *vtable))
+
+/* can be used for classes without finalizer in non-profiling mode */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_fast, (MonoVTable *vtable))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_alloc_specific, (MonoVTable *vtable))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_from_token, (MonoDomain *domain, MonoImage *image, uint32_t token))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new, (MonoDomain *domain, MonoClass *eclass, uintptr_t n))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new_full, (MonoDomain *domain, MonoClass *array_class, uintptr_t *lengths, intptr_t *lower_bounds))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray *, mono_array_new_specific, (MonoVTable *vtable, uintptr_t n))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_clone, (MonoArray *array))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY char*, mono_array_addr_with_size, (MonoArray *array, int size, uintptr_t idx))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uintptr_t, mono_array_length, (MonoArray *array))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty_wrapper, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf16, (MonoDomain *domain, const mono_unichar2 *text, int32_t len))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_size, (MonoDomain *domain, int32_t len))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_ldstr, (MonoDomain *domain, MonoImage *image, uint32_t str_index))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_is_interned, (MonoString *str))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_intern, (MonoString *str))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new, (MonoDomain *domain, const char *text))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_wrapper, (const char *text))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_len, (MonoDomain *domain, const char *text, unsigned int length))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf32, (MonoDomain *domain, const mono_unichar4 *text, int32_t len))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8, (MonoString *string_obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8_checked, (MonoString *string_obj, MonoError *error))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_to_utf16, (MonoString *string_obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar4 *, mono_string_to_utf32, (MonoString *string_obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf16, (/*const*/ mono_unichar2 *data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf32, (/*const*/ mono_unichar4 *data))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_string_equal, (MonoString *s1, MonoString *s2))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY unsigned int, mono_string_hash, (MonoString *s))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_object_hash, (MonoObject* obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString *, mono_object_to_string, (MonoObject *obj, MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_value_box, (MonoDomain *domain, MonoClass *klass, void* val))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_value_copy, (void* dest, /*const*/ void* src, MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_value_copy_array, (MonoArray *dest, int dest_idx, void* src, int count))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoVTable*, mono_object_get_vtable, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_object_get_domain, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_object_get_class, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_object_unbox, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_clone, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst, (MonoObject *obj, MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst_mbyref, (MonoObject *obj, MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_castclass_mbyref, (MonoObject *obj, MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_try_enter, (MonoObject *obj, uint32_t ms))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_enter, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_monitor_enter_v4, (MonoObject *obj, char *lock_taken))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY unsigned int, mono_object_get_size, (MonoObject *o))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_monitor_exit, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_raise_exception, (MonoException *ex))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_runtime_set_pending_exception, (MonoException *exc, mono_bool overwrite))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_reraise_exception, (MonoException *ex))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_object_init, (MonoObject *this_obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_class_init, (MonoVTable *vtable))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_vtable_domain, (MonoVTable *vtable))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_vtable_class, (MonoVTable *vtable))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_object_get_virtual_method, (MonoObject *obj, MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke, (MonoMethod *method, void *obj, void **params, MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_invoke, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_begin_invoke, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_end_invoke, (MonoClass *klass))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_delegate_invoke, (MonoObject *delegate, void **params, MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke_array, (MonoMethod *method, void *obj, MonoArray *params, MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_method_get_unmanaged_thunk, (MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_runtime_get_main_args, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_exec_managed_code, (MonoDomain *domain, MonoMainThreadFunc main_func, void* main_args))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_runtime_run_main, (MonoMethod *method, int argc, char* argv[],MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_runtime_exec_main, (MonoMethod *method, MonoArray *args, MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_runtime_set_main_args, (int argc, char* argv[]))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_load_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void **res))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_load_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void* val))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_unhandled_exception, (MonoObject *exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_print_unhandled_exception, (MonoObject *exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_compile_method, (MonoMethod *method))
+
+/* accessors for fields and properties */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_set_value, (MonoObject *obj, MonoClassField *field, void *value))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_static_set_value, (MonoVTable *vt, MonoClassField *field, void *value))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_get_value, (MonoObject *obj, MonoClassField *field, void *value))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_static_get_value, (MonoVTable *vt, MonoClassField *field, void *value))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_field_get_value_object, (MonoDomain *domain, MonoClassField *field, MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_property_set_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_property_get_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc))
+
+/* GC handles support
+ *
+ * A handle can be created to refer to a managed object and either prevent it
+ * from being garbage collected or moved or to be able to know if it has been
+ * collected or not (weak references).
+ * mono_gchandle_new () is used to prevent an object from being garbage collected
+ * until mono_gchandle_free() is called. Use a TRUE value for the pinned argument to
+ * prevent the object from being moved (this should be avoided as much as possible
+ * and this should be used only for shorts periods of time or performance will suffer).
+ * To create a weakref use mono_gchandle_new_weakref (): track_resurrection should
+ * usually be false (see the GC docs for more details).
+ * mono_gchandle_get_target () can be used to get the object referenced by both kinds
+ * of handle: for a weakref handle, if an object has been collected, it will return NULL.
+ */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new, (MonoObject *obj, mono_bool pinned))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new_weakref, (MonoObject *obj, mono_bool track_resurrection))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_gchandle_get_target, (uint32_t gchandle))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free, (uint32_t gchandle))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_v2, (MonoObject *obj, mono_bool pinned))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_weakref_v2, (MonoObject *obj, mono_bool track_resurrection))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*,  mono_gchandle_get_target_v2,  (MonoGCHandle gchandle))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free_v2, (MonoGCHandle gchandle))
+
+/* Reference queue support
+ *
+ * A reference queue is used to get notifications of when objects are collected.
+ * Call mono_gc_reference_queue_new to create a new queue and pass the callback that
+ * will be invoked when registered objects are collected.
+ * Call mono_gc_reference_queue_add to register a pair of objects and data within a queue.
+ * The callback will be triggered once an object is both unreachable and finalized.
+ */
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReferenceQueue*, mono_gc_reference_queue_new, (mono_reference_queue_callback callback))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_reference_queue_free, (MonoReferenceQueue *queue))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_gc_reference_queue_add, (MonoReferenceQueue *queue, MonoObject *obj, void *user_data))
+
+/* GC write barriers support */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_field, (MonoObject *obj, void* field_ptr, MonoObject* value))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_arrayref, (MonoArray *arr, void* slot_ptr, MonoObject* value))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_arrayref_copy, (void* dest_ptr, /*const*/ void* src_ptr, int count))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store, (void* ptr, MonoObject* value))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store_atomic, (void *ptr, MonoObject *value))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_nostore, (void* ptr))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_value_copy, (void* dest, /*const*/ void* src, int count, MonoClass *klass))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_object_copy, (MonoObject* obj, MonoObject *src))
+
diff --git a/src/native/public/mono/metadata/details/object-types.h b/src/native/public/mono/metadata/details/object-types.h
new file mode 100644
index 00000000000000..e95e7eec28fdd1
--- /dev/null
+++ b/src/native/public/mono/metadata/details/object-types.h
@@ -0,0 +1,44 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_OBJECT_TYPES_H
+#define _MONO_OBJECT_TYPES_H
+
+#include <mono/utils/mono-forward.h>
+#include <mono/metadata/object-forward.h>
+#include <mono/metadata/details/class-types.h>
+#include <mono/utils/details/mono-error-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct _MonoString MONO_RT_MANAGED_ATTR MonoString;
+typedef struct _MonoArray MONO_RT_MANAGED_ATTR MonoArray;
+typedef struct _MonoReflectionMethod MONO_RT_MANAGED_ATTR MonoReflectionMethod;
+typedef struct _MonoReflectionModule MONO_RT_MANAGED_ATTR MonoReflectionModule;
+typedef struct _MonoReflectionField MONO_RT_MANAGED_ATTR MonoReflectionField;
+typedef struct _MonoReflectionProperty MONO_RT_MANAGED_ATTR MonoReflectionProperty;
+typedef struct _MonoReflectionEvent MONO_RT_MANAGED_ATTR MonoReflectionEvent;
+typedef struct _MonoReflectionType MONO_RT_MANAGED_ATTR MonoReflectionType;
+typedef struct _MonoDelegate MONO_RT_MANAGED_ATTR MonoDelegate;
+typedef struct _MonoThreadsSync MonoThreadsSync;
+typedef struct _MonoInternalThread MONO_RT_MANAGED_ATTR MonoThread;
+typedef struct _MonoDynamicAssembly MonoDynamicAssembly;
+typedef struct _MonoDynamicImage MonoDynamicImage;
+typedef struct _MonoReflectionMethodBody MONO_RT_MANAGED_ATTR MonoReflectionMethodBody;
+typedef struct _MonoAppContext MONO_RT_MANAGED_ATTR MonoAppContext;
+
+struct _MonoObject {
+	MonoVTable *vtable;
+	MonoThreadsSync *synchronisation;
+};
+
+typedef MonoObject* (*MonoInvokeFunc)	     (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error);
+typedef void*    (*MonoCompileFunc)	     (MonoMethod *method);
+typedef void	    (*MonoMainThreadFunc)    (void* user_data);
+
+typedef void (*mono_reference_queue_callback) (void *user_data);
+typedef struct _MonoReferenceQueue MonoReferenceQueue;
+
+MONO_END_DECLS
+
+#endif /* _MONO_OBJECT_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/opcodes-functions.h b/src/native/public/mono/metadata/details/opcodes-functions.h
new file mode 100644
index 00000000000000..55e023a959a9dc
--- /dev/null
+++ b/src/native/public/mono/metadata/details/opcodes-functions.h
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API const char*, mono_opcode_name, (int opcode))
+
+MONO_API_FUNCTION(MONO_API MonoOpcodeEnum, mono_opcode_value, (const mono_byte **ip, const mono_byte *end))
+
diff --git a/src/native/public/mono/metadata/details/opcodes-types.h b/src/native/public/mono/metadata/details/opcodes-types.h
new file mode 100644
index 00000000000000..7f923f2b69ab82
--- /dev/null
+++ b/src/native/public/mono/metadata/details/opcodes-types.h
@@ -0,0 +1,62 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_OPCODES_TYPES_H
+#define _MONO_OPCODES_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+
+MONO_BEGIN_DECLS
+
+#define MONO_CUSTOM_PREFIX 0xf0
+
+#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
+	MONO_ ## a,
+
+typedef enum MonoOpcodeEnum {
+	MonoOpcodeEnum_Invalid = -1,
+#include "mono/cil/opcode.def"
+	MONO_CEE_LAST
+} MonoOpcodeEnum;
+
+#undef OPDEF
+
+enum {
+	MONO_FLOW_NEXT,
+	MONO_FLOW_BRANCH,
+	MONO_FLOW_COND_BRANCH,
+	MONO_FLOW_ERROR,
+	MONO_FLOW_CALL,
+	MONO_FLOW_RETURN,
+	MONO_FLOW_META
+};
+
+enum {
+	MonoInlineNone          = 0,
+	MonoInlineType          = 1,
+	MonoInlineField         = 2,
+	MonoInlineMethod        = 3,
+	MonoInlineTok           = 4,
+	MonoInlineString        = 5,
+	MonoInlineSig           = 6,
+	MonoInlineVar           = 7,
+	MonoShortInlineVar      = 8,
+	MonoInlineBrTarget      = 9,
+	MonoShortInlineBrTarget = 10,
+	MonoInlineSwitch        = 11,
+	MonoInlineR             = 12,
+	MonoShortInlineR        = 13,
+	MonoInlineI             = 14,
+	MonoShortInlineI        = 15,
+	MonoInlineI8            = 16,
+};
+
+typedef struct {
+	unsigned char argument;
+	unsigned char flow_type;
+	unsigned short opval;
+} MonoOpcode;
+
+MONO_END_DECLS
+
+#endif /* _MONO_OPCODES_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/profiler-functions.h b/src/native/public/mono/metadata/details/profiler-functions.h
new file mode 100644
index 00000000000000..e02d8db506bf6f
--- /dev/null
+++ b/src/native/public/mono/metadata/details/profiler-functions.h
@@ -0,0 +1,30 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_profiler_load, (const char *desc))
+MONO_API_FUNCTION(MONO_API MonoProfilerHandle, mono_profiler_create, (MonoProfiler *prof))
+MONO_API_FUNCTION(MONO_API void, mono_profiler_set_cleanup_callback, (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_coverage, (void))
+MONO_API_FUNCTION(MONO_API void, mono_profiler_set_coverage_filter_callback, (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_get_coverage_data, (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_sampling, (MonoProfilerHandle handle))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_set_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_get_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_allocations, (void))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_clauses, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_profiler_set_call_instrumentation_filter_callback, (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_call_context_introspection, (void))
+MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_this, (MonoProfilerCallContext *context))
+MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_argument, (MonoProfilerCallContext *context, uint32_t position))
+MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_local, (MonoProfilerCallContext *context, uint32_t position))
+MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_result, (MonoProfilerCallContext *context))
+MONO_API_FUNCTION(MONO_API void, mono_profiler_call_context_free_buffer, (void *buffer))
diff --git a/src/native/public/mono/metadata/details/profiler-types.h b/src/native/public/mono/metadata/details/profiler-types.h
new file mode 100644
index 00000000000000..966459e58e3337
--- /dev/null
+++ b/src/native/public/mono/metadata/details/profiler-types.h
@@ -0,0 +1,131 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_PROFILER_TYPES_H
+#define _MONO_PROFILER_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/metadata/details/appdomain-types.h>
+#include <mono/metadata/details/mono-gc-types.h>
+#include <mono/metadata/details/object-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct _MonoProfiler MonoProfiler;
+typedef struct _MonoProfilerDesc *MonoProfilerHandle;
+
+typedef void (*MonoProfilerCleanupCallback) (MonoProfiler *prof);
+
+typedef struct {
+	MonoMethod *method;
+	uint32_t il_offset;
+	uint32_t counter;
+	const char *file_name;
+	uint32_t line;
+	uint32_t column;
+} MonoProfilerCoverageData;
+
+typedef mono_bool (*MonoProfilerCoverageFilterCallback) (MonoProfiler *prof, MonoMethod *method);
+typedef void (*MonoProfilerCoverageCallback) (MonoProfiler *prof, const MonoProfilerCoverageData *data);
+
+typedef enum {
+	/**
+	 * Do not perform sampling. Will make the sampling thread sleep until the
+	 * sampling mode is changed to one of the below modes.
+	 */
+	MONO_PROFILER_SAMPLE_MODE_NONE = 0,
+	/**
+	 * Try to base sampling frequency on process activity. Falls back to
+	 * MONO_PROFILER_SAMPLE_MODE_REAL if such a clock is not available.
+	 */
+	MONO_PROFILER_SAMPLE_MODE_PROCESS = 1,
+	/**
+	 * Base sampling frequency on wall clock time. Uses a monotonic clock when
+	 * available (all major platforms).
+	 */
+	MONO_PROFILER_SAMPLE_MODE_REAL = 2,
+} MonoProfilerSampleMode;
+
+typedef struct _MonoProfilerCallContext MonoProfilerCallContext;
+
+typedef enum {
+	/**
+	 * Do not instrument calls.
+	 */
+	MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 0,
+	/**
+	 * Instrument method entries.
+	 */
+	MONO_PROFILER_CALL_INSTRUMENTATION_ENTER = 1 << 1,
+	/**
+	 * Also capture a call context for method entries.
+	 */
+	MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT = 1 << 2,
+	/**
+	 * Instrument method exits.
+	 */
+	MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE = 1 << 3,
+	/**
+	 * Also capture a call context for method exits.
+	 */
+	MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT = 1 << 4,
+	/**
+	 * Instrument method exits as a result of a tail call.
+	 */
+	MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL = 1 << 5,
+	/**
+	 * Instrument exceptional method exits.
+	 */
+	MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE = 1 << 6,
+} MonoProfilerCallInstrumentationFlags;
+
+typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFilterCallback) (MonoProfiler *prof, MonoMethod *method);
+
+typedef enum {
+	/**
+	 * The \c data parameter is a \c MonoMethod pointer.
+	 */
+	MONO_PROFILER_CODE_BUFFER_METHOD = 0,
+	/**
+	 * \deprecated No longer used.
+	 */
+	MONO_PROFILER_CODE_BUFFER_METHOD_TRAMPOLINE = 1,
+	/**
+	 * The \c data parameter is a \c MonoMethod pointer.
+	 */
+	MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE = 2,
+	MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE = 3,
+	MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE = 4,
+	/**
+	 * The \c data parameter is a C string.
+	 */
+	MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE = 5,
+	MONO_PROFILER_CODE_BUFFER_HELPER = 6,
+	/**
+	 * \deprecated No longer used.
+	 */
+	MONO_PROFILER_CODE_BUFFER_MONITOR = 7,
+	MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE = 8,
+	MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 9,
+} MonoProfilerCodeBufferType;
+
+typedef enum {
+	MONO_GC_EVENT_PRE_STOP_WORLD = 6,
+	/**
+	 * When this event arrives, the GC and suspend locks are acquired.
+	 */
+	MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10,
+	MONO_GC_EVENT_POST_STOP_WORLD = 7,
+	MONO_GC_EVENT_START = 0,
+	MONO_GC_EVENT_END = 5,
+	MONO_GC_EVENT_PRE_START_WORLD = 8,
+	/**
+	 * When this event arrives, the GC and suspend locks are released.
+	 */
+	MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11,
+	MONO_GC_EVENT_POST_START_WORLD = 9,
+} MonoProfilerGCEvent;
+
+MONO_END_DECLS
+
+#endif /* _MONO_PROFILER_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/reflection-functions.h b/src/native/public/mono/metadata/details/reflection-functions.h
new file mode 100644
index 00000000000000..21f025ebafe91e
--- /dev/null
+++ b/src/native/public/mono/metadata/details/reflection-functions.h
@@ -0,0 +1,66 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_reflection_parse_type, (char *name, MonoTypeNameParse *info))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_get_type, (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve))
+MONO_API_FUNCTION(MONO_API void, mono_reflection_free_type_info, (MonoTypeNameParse *info))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_from_name, (char *name, MonoImage *image))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uint32_t, mono_reflection_get_token, (MonoObject *obj))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly*, mono_assembly_get_object, (MonoDomain *domain, MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_get_object, (MonoDomain *domain, MonoImage *image))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_file_get_object, (MonoDomain *domain, MonoImage *image, int table_index))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionType*, mono_type_get_object, (MonoDomain *domain, MonoType *type))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionMethod*, mono_method_get_object, (MonoDomain *domain, MonoMethod *method, MonoClass *refclass))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionField*, mono_field_get_object, (MonoDomain *domain, MonoClass *klass, MonoClassField *field))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionProperty*, mono_property_get_object, (MonoDomain *domain, MonoClass *klass, MonoProperty *property))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionEvent*, mono_event_get_object, (MonoDomain *domain, MonoClass *klass, MonoEvent *event))
+/* note: this one is slightly different: we keep the whole array of params in the cache */
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_param_get_objects, (MonoDomain *domain, MonoMethod *method))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionMethodBody*, mono_method_body_get_object, (MonoDomain *domain, MonoMethod *method))
+
+MONO_API_FUNCTION(MONO_API MonoObject *, mono_get_dbnull_object, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API MonoArray*, mono_reflection_get_custom_attrs_by_type, (MonoObject *obj, MonoClass *attr_klass, MonoError *error))
+MONO_API_FUNCTION(MONO_API MonoArray*, mono_reflection_get_custom_attrs, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_data, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_blob, (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_reflection_get_custom_attrs_info, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_custom_attrs_construct, (MonoCustomAttrInfo *cinfo))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_index, (MonoImage *image, uint32_t idx))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_method, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_class, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_assembly, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_property, (MonoClass *klass, MonoProperty *property))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_event, (MonoClass *klass, MonoEvent *event))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_field, (MonoClass *klass, MonoClassField *field))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_param, (MonoMethod *method, uint32_t param))
+MONO_API_FUNCTION(MONO_API mono_bool, mono_custom_attrs_has_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_custom_attrs_get_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass))
+MONO_API_FUNCTION(MONO_API void, mono_custom_attrs_free, (MonoCustomAttrInfo *ainfo))
+
+
+MONO_API_FUNCTION(MONO_API uint32_t, mono_declsec_flags_from_method, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_declsec_flags_from_class, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_declsec_flags_from_assembly, (MonoAssembly *assembly))
+
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_demands, (MonoMethod *callee, MonoDeclSecurityActions* demands))
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_linkdemands, (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* cmethod))
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_inheritdemands_class, (MonoClass *klass, MonoDeclSecurityActions* demands))
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_inheritdemands_method, (MonoMethod *callee, MonoDeclSecurityActions* demands))
+
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_method_action, (MonoMethod *method, uint32_t action, MonoDeclSecurityEntry *entry))
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_class_action, (MonoClass *klass, uint32_t action, MonoDeclSecurityEntry *entry))
+MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_assembly_action, (MonoAssembly *assembly, uint32_t action, MonoDeclSecurityEntry *entry))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_get_type, (MonoReflectionType *reftype))
+
+MONO_API_FUNCTION(MONO_API MonoAssembly*, mono_reflection_assembly_get_assembly, (MonoReflectionAssembly *refassembly))
+
+
diff --git a/src/native/public/mono/metadata/details/reflection-types.h b/src/native/public/mono/metadata/details/reflection-types.h
new file mode 100644
index 00000000000000..b2b680e1d788d2
--- /dev/null
+++ b/src/native/public/mono/metadata/details/reflection-types.h
@@ -0,0 +1,88 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_REFLECTION_TYPES_H
+#define _MONO_REFLECTION_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/metadata/details/object-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct MonoTypeNameParse MonoTypeNameParse;
+
+typedef struct {
+	MonoMethod *ctor;
+	uint32_t     data_size;
+	const mono_byte* data;
+} MonoCustomAttrEntry;
+
+typedef struct {
+	int num_attrs;
+	int cached;
+	MonoImage *image;
+	MonoCustomAttrEntry attrs [MONO_ZERO_LEN_ARRAY];
+} MonoCustomAttrInfo;
+
+#define MONO_SIZEOF_CUSTOM_ATTR_INFO (offsetof (MonoCustomAttrInfo, attrs))
+
+/*
+ * Information which isn't in the MonoMethod structure is stored here for
+ * dynamic methods.
+ */
+typedef struct {
+	char **param_names;
+	MonoMarshalSpec **param_marshall;
+	MonoCustomAttrInfo **param_cattr;
+	uint8_t** param_defaults;
+	uint32_t *param_default_types;
+	char *dllentry, *dll;
+} MonoReflectionMethodAux;
+
+typedef enum {
+	ResolveTokenError_OutOfRange,
+	ResolveTokenError_BadTable,
+	ResolveTokenError_Other
+} MonoResolveTokenError;
+
+#define MONO_DECLSEC_ACTION_MIN		0x1
+#define MONO_DECLSEC_ACTION_MAX		0x12
+
+enum {
+	MONO_DECLSEC_FLAG_REQUEST 			= 0x00000001,
+	MONO_DECLSEC_FLAG_DEMAND			= 0x00000002,
+	MONO_DECLSEC_FLAG_ASSERT			= 0x00000004,
+	MONO_DECLSEC_FLAG_DENY				= 0x00000008,
+	MONO_DECLSEC_FLAG_PERMITONLY			= 0x00000010,
+	MONO_DECLSEC_FLAG_LINKDEMAND			= 0x00000020,
+	MONO_DECLSEC_FLAG_INHERITANCEDEMAND		= 0x00000040,
+	MONO_DECLSEC_FLAG_REQUEST_MINIMUM		= 0x00000080,
+	MONO_DECLSEC_FLAG_REQUEST_OPTIONAL		= 0x00000100,
+	MONO_DECLSEC_FLAG_REQUEST_REFUSE		= 0x00000200,
+	MONO_DECLSEC_FLAG_PREJIT_GRANT			= 0x00000400,
+	MONO_DECLSEC_FLAG_PREJIT_DENY			= 0x00000800,
+	MONO_DECLSEC_FLAG_NONCAS_DEMAND			= 0x00001000,
+	MONO_DECLSEC_FLAG_NONCAS_LINKDEMAND		= 0x00002000,
+	MONO_DECLSEC_FLAG_NONCAS_INHERITANCEDEMAND	= 0x00004000,
+	MONO_DECLSEC_FLAG_LINKDEMAND_CHOICE		= 0x00008000,
+	MONO_DECLSEC_FLAG_INHERITANCEDEMAND_CHOICE	= 0x00010000,
+	MONO_DECLSEC_FLAG_DEMAND_CHOICE			= 0x00020000
+};
+
+/* this structure MUST be kept in synch with RuntimeDeclSecurityEntry
+ * located in /mcs/class/corlib/System.Security/SecurityFrame.cs */
+typedef struct {
+	char *blob;				/* pointer to metadata blob */
+	uint32_t size;				/* size of the metadata blob */
+	uint32_t index;
+} MonoDeclSecurityEntry;
+
+typedef struct {
+	MonoDeclSecurityEntry demand;
+	MonoDeclSecurityEntry noncasdemand;
+	MonoDeclSecurityEntry demandchoice;
+} MonoDeclSecurityActions;
+
+MONO_END_DECLS
+
+#endif /* _MONO_REFLECTION_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/sgen-bridge-functions.h b/src/native/public/mono/metadata/details/sgen-bridge-functions.h
new file mode 100644
index 00000000000000..a8f1aa4fe662ee
--- /dev/null
+++ b/src/native/public/mono/metadata/details/sgen-bridge-functions.h
@@ -0,0 +1,19 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+/*
+ * Note: This may be called at any time, but cannot be called concurrently
+ * with (during and on a separate thread from) sgen init. Callers are
+ * responsible for enforcing this.
+ */
+MONO_API_FUNCTION(MONO_API void, mono_gc_register_bridge_callbacks, (MonoGCBridgeCallbacks *callbacks))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wait_for_bridge_processing, (void))
+
+
+
diff --git a/src/native/public/mono/metadata/details/sgen-bridge-types.h b/src/native/public/mono/metadata/details/sgen-bridge-types.h
new file mode 100644
index 00000000000000..cdb0be9ab359a9
--- /dev/null
+++ b/src/native/public/mono/metadata/details/sgen-bridge-types.h
@@ -0,0 +1,55 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_SGEN_BRIDGE_TYPES_H
+#define _MONO_SGEN_BRIDGE_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+
+MONO_BEGIN_DECLS
+
+enum {
+	SGEN_BRIDGE_VERSION = 5
+};
+
+typedef enum {
+	/* Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List<object>*/
+	GC_BRIDGE_TRANSPARENT_CLASS,
+	/* Instances of this class should not be scanned when computing the transitive dependency among bridges. E.g. String*/
+	GC_BRIDGE_OPAQUE_CLASS,
+	/* Instances of this class should be bridged and have their dependency computed. */
+	GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS,
+	/* Instances of this class should be bridged but no dependencies should not be calculated. */
+	GC_BRIDGE_OPAQUE_BRIDGE_CLASS,
+} MonoGCBridgeObjectKind;
+
+typedef struct {
+	mono_bool is_alive;	/* to be set by the cross reference callback */
+	int num_objs;
+	MonoObject *objs [MONO_ZERO_LEN_ARRAY];
+} MonoGCBridgeSCC;
+
+typedef struct {
+	int src_scc_index;
+	int dst_scc_index;
+} MonoGCBridgeXRef;
+
+typedef struct {
+	int bridge_version;
+	/*
+	 * Tells the runtime which classes to even consider when looking for
+	 * bridged objects.  If subclasses are to be considered as well, the
+	 * subclass check must be done in the callback.
+	 */
+	MonoGCBridgeObjectKind (*bridge_class_kind) (MonoClass *klass);
+	/*
+	 * This is only called on objects for whose classes
+	 * `bridge_class_kind()` returned `XXX_BRIDGE_CLASS`.
+	 */
+	mono_bool (*is_bridge_object) (MonoObject *object);
+	void (*cross_references) (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs);
+} MonoGCBridgeCallbacks;
+
+MONO_END_DECLS
+
+#endif /* _MONO_SGEN_BRIDGE_TYPES_H */
diff --git a/src/native/public/mono/metadata/details/threads-functions.h b/src/native/public/mono/metadata/details/threads-functions.h
new file mode 100644
index 00000000000000..214bf81196df9b
--- /dev/null
+++ b/src/native/public/mono/metadata/details/threads-functions.h
@@ -0,0 +1,43 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API void, mono_thread_init, (MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_cleanup, (void))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_manage, (void))
+
+MONO_API_FUNCTION(MONO_API MonoThread *, mono_thread_current, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_thread_set_main, (MonoThread *thread))
+MONO_API_FUNCTION(MONO_API MonoThread *, mono_thread_get_main, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_stop, (MonoThread *thread))
+
+MONO_API_FUNCTION(MONO_API void, mono_thread_new_init, (intptr_t tid, void* stack_start, void* func))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_create, (MonoDomain *domain, void* func, void* arg))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoThread *, mono_thread_attach, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_detach, (MonoThread *thread))
+MONO_API_FUNCTION(MONO_API void, mono_thread_exit, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_threads_attach_tools_thread, (void))
+
+MONO_API_FUNCTION(MONO_API char *, mono_thread_get_name_utf8, (MonoThread *thread))
+MONO_API_FUNCTION(MONO_API int32_t, mono_thread_get_managed_id, (MonoThread *thread))
+
+MONO_API_FUNCTION(MONO_API void, mono_thread_set_manage_callback, (MonoThread *thread, MonoThreadManageCallback func))
+
+MONO_API_FUNCTION(MONO_API void, mono_threads_set_default_stacksize, (uint32_t stacksize))
+MONO_API_FUNCTION(MONO_API uint32_t, mono_threads_get_default_stacksize, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_threads_request_thread_dump, (void))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_thread_is_foreign, (MonoThread *thread))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_thread_detach_if_exiting, (void))
+
diff --git a/src/native/public/mono/metadata/details/threads-types.h b/src/native/public/mono/metadata/details/threads-types.h
new file mode 100644
index 00000000000000..d79d0abe045d47
--- /dev/null
+++ b/src/native/public/mono/metadata/details/threads-types.h
@@ -0,0 +1,18 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_METADATA_DETAILS_THREADS_TYPES_H
+#define _MONO_METADATA_DETAILS_THREADS_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/metadata/details/object-types.h>
+#include <mono/metadata/details/appdomain-types.h>
+
+MONO_BEGIN_DECLS
+
+/* This callback should return TRUE if the runtime must wait for the thread, FALSE otherwise */
+typedef mono_bool (*MonoThreadManageCallback) (MonoThread* thread);
+
+MONO_END_DECLS
+
+#endif /* _MONO_METADATA_DETAILS_THREADS_TYPES_H */
diff --git a/src/native/public/mono/metadata/environment.h b/src/native/public/mono/metadata/environment.h
index 1fb5a57b31ecb5..7cf36f0483dd9c 100644
--- a/src/native/public/mono/metadata/environment.h
+++ b/src/native/public/mono/metadata/environment.h
@@ -15,8 +15,9 @@
 
 MONO_BEGIN_DECLS
 
-MONO_API int32_t mono_environment_exitcode_get (void);
-MONO_API void mono_environment_exitcode_set (int32_t value);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/environment-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/exception.h b/src/native/public/mono/metadata/exception.h
index 0876657ac2e60e..1d66ff054a30aa 100644
--- a/src/native/public/mono/metadata/exception.h
+++ b/src/native/public/mono/metadata/exception.h
@@ -5,171 +5,14 @@
 #ifndef _MONO_METADATA_EXCEPTION_H_
 #define _MONO_METADATA_EXCEPTION_H_
 
-#include <mono/metadata/object-forward.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/image.h>
+#include <mono/metadata/details/exception-types.h>
 
 MONO_BEGIN_DECLS
 
-MONO_API MonoException *
-mono_exception_from_name               (MonoImage *image,
-					const char* name_space,
-					const char *name);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/exception-functions.h>
+#undef MONO_API_FUNCTION
 
-MONO_API MonoException *
-mono_exception_from_token              (MonoImage *image, uint32_t token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_exception_from_name_two_strings (MonoImage *image, const char *name_space,
-				      const char *name, MonoString *a1, MonoString *a2);
-
-MONO_API MonoException *
-mono_exception_from_name_msg	       (MonoImage *image, const char *name_space,
-					const char *name, const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_exception_from_token_two_strings (MonoImage *image, uint32_t token,
-						   MonoString *a1, MonoString *a2);
-
-MONO_API MonoException *
-mono_exception_from_name_domain        (MonoDomain *domain, MonoImage *image,
-					const char* name_space,
-					const char *name);
-
-MONO_API MonoException *
-mono_get_exception_divide_by_zero      (void);
-
-MONO_API MonoException *
-mono_get_exception_security            (void);
-
-MONO_API MonoException *
-mono_get_exception_arithmetic          (void);
-
-MONO_API MonoException *
-mono_get_exception_overflow            (void);
-
-MONO_API MonoException *
-mono_get_exception_null_reference      (void);
-
-MONO_API MonoException *
-mono_get_exception_execution_engine    (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_thread_abort        (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_thread_state        (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_thread_interrupted  (void);
-
-MONO_API MonoException *
-mono_get_exception_serialization       (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_invalid_cast        (void);
-
-MONO_API MonoException *
-mono_get_exception_invalid_operation (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_index_out_of_range  (void);
-
-MONO_API MonoException *
-mono_get_exception_array_type_mismatch (void);
-
-MONO_API MonoException *
-mono_get_exception_type_load           (MonoString *class_name, char *assembly_name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_missing_method      (const char *class_name, const char *member_name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_missing_field       (const char *class_name, const char *member_name);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_not_implemented     (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_not_supported       (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoException*
-mono_get_exception_argument_null       (const char *arg);
-
-MONO_API MonoException *
-mono_get_exception_argument            (const char *arg, const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_argument_out_of_range (const char *arg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_io                    (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_file_not_found        (MonoString *fname);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_file_not_found2       (const char *msg, MonoString *fname);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_type_initialization (const char *type_name, MonoException *inner);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_synchronization_lock (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_cannot_unload_appdomain (const char *msg);
-
-MONO_API MonoException *
-mono_get_exception_appdomain_unloaded (void);
-
-MONO_API MonoException *
-mono_get_exception_bad_image_format (const char *msg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_bad_image_format2 (const char *msg, MonoString *fname);
-
-MONO_API MonoException *
-mono_get_exception_stack_overflow (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_out_of_memory (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_field_access (void);
-
-MONO_API MonoException *
-mono_get_exception_method_access (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoException *
-mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception);
-
-/* Installs a function which is called when the runtime encounters an unhandled exception.
- * This hook isn't expected to return.
- * If no hook has been installed, the runtime will print a message before aborting.
- */
-typedef void  (*MonoUnhandledExceptionFunc)         (MonoObject *exc, void *user_data);
-MONO_API void mono_install_unhandled_exception_hook (MonoUnhandledExceptionFunc func, void *user_data);
 void          mono_invoke_unhandled_exception_hook  (MonoObject *exc);
 
 MONO_END_DECLS
diff --git a/src/native/public/mono/metadata/image.h b/src/native/public/mono/metadata/image.h
index 4b43eefaf05e93..f0a22034c6e74e 100644
--- a/src/native/public/mono/metadata/image.h
+++ b/src/native/public/mono/metadata/image.h
@@ -5,92 +5,13 @@
 #ifndef _MONONET_METADATA_IMAGE_H_
 #define _MONONET_METADATA_IMAGE_H_
 
-#include <stdio.h>
-#include <mono/utils/mono-publib.h>
-#include <mono/utils/mono-error.h>
-#include <mono/metadata/object-forward.h>
+#include <mono/metadata/details/image-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef struct _MonoAssembly MonoAssembly;
-typedef struct _MonoAssemblyName MonoAssemblyName;
-typedef struct _MonoTableInfo MonoTableInfo;
-
-typedef enum {
-	MONO_IMAGE_OK,
-	MONO_IMAGE_ERROR_ERRNO,
-	MONO_IMAGE_MISSING_ASSEMBLYREF,
-	MONO_IMAGE_IMAGE_INVALID
-} MonoImageOpenStatus;
-
-MONO_API void          mono_images_init    (void);
-MONO_API MONO_RT_EXTERNAL_ONLY void          mono_images_cleanup (void);
-
-MONO_API MonoImage    *mono_image_open     (const char *fname,
-				   MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_open_full (const char *fname,
-				   MonoImageOpenStatus *status, mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_pe_file_open     (const char *fname,
-				     MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_image_open_from_data (char *data, uint32_t data_len, mono_bool need_copy,
-                                         MonoImageOpenStatus *status);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_image_open_from_data_full (char *data, uint32_t data_len, mono_bool need_copy,
-                                         MonoImageOpenStatus *status, mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage    *mono_image_open_from_data_with_name (char *data, uint32_t data_len, mono_bool need_copy,
-                                                   MonoImageOpenStatus *status, mono_bool refonly, const char *name);
-MONO_API void          mono_image_fixup_vtable (MonoImage *image);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded   (const char *name);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded_full   (const char *name, mono_bool refonly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded_by_guid (const char *guid);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoImage             *mono_image_loaded_by_guid_full (const char *guid, mono_bool refonly);
-MONO_API void          mono_image_init     (MonoImage *image);
-MONO_API void          mono_image_close    (MonoImage *image);
-MONO_API void          mono_image_addref   (MonoImage *image);
-MONO_API const char   *mono_image_strerror (MonoImageOpenStatus status);
-
-MONO_API int           mono_image_ensure_section     (MonoImage *image,
-					     const char *section);
-MONO_API int           mono_image_ensure_section_idx (MonoImage *image,
-					     int section);
-
-MONO_API uint32_t       mono_image_get_entry_point    (MonoImage *image);
-MONO_API const char   *mono_image_get_resource       (MonoImage *image, uint32_t offset, uint32_t *size);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*    mono_image_load_file_for_image (MonoImage *image, int fileidx);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*    mono_image_load_module (MonoImage *image, int idx);
-
-MONO_API const char*   mono_image_get_name       (MonoImage *image);
-MONO_API const char*   mono_image_get_filename   (MonoImage *image);
-MONO_API const char *  mono_image_get_guid       (MonoImage *image);
-MONO_API MonoAssembly* mono_image_get_assembly   (MonoImage *image);
-MONO_API mono_bool     mono_image_is_dynamic     (MonoImage *image);
-MONO_API char*         mono_image_rva_map        (MonoImage *image, uint32_t rva);
-
-MONO_API const MonoTableInfo *mono_image_get_table_info (MonoImage *image, int table_id);
-MONO_API int                  mono_image_get_table_rows (MonoImage *image, int table_id);
-MONO_API int                  mono_table_info_get_rows  (const MonoTableInfo *table);
-
-/* This actually returns a MonoPEResourceDataEntry *, but declaring it
- * causes an include file loop.
- */
-MONO_API void*      mono_image_lookup_resource (MonoImage *image, uint32_t res_id,
-					  uint32_t lang_id, mono_unichar2 *name);
-
-MONO_API const char*   mono_image_get_public_key  (MonoImage *image, uint32_t *size);
-MONO_API const char*   mono_image_get_strong_name (MonoImage *image, uint32_t *size);
-MONO_API uint32_t       mono_image_strong_name_position (MonoImage *image, uint32_t *size);
-MONO_API void          mono_image_add_to_name_cache (MonoImage *image,
-			const char *nspace, const char *name, uint32_t idx);
-MONO_API mono_bool     mono_image_has_authenticode_entry (MonoImage *image);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/image-functions.h>
+#undef MONO_API_FUNCTION
 
 mono_bool mono_has_pdb_checksum (char *raw_data, uint32_t raw_data_len);
 
diff --git a/src/native/public/mono/metadata/loader.h b/src/native/public/mono/metadata/loader.h
index c1468257867a7f..2d27f5f803eaf4 100644
--- a/src/native/public/mono/metadata/loader.h
+++ b/src/native/public/mono/metadata/loader.h
@@ -5,103 +5,13 @@
 #ifndef _MONO_METADATA_LOADER_H_
 #define _MONO_METADATA_LOADER_H_ 1
 
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/metadata.h>
-#include <mono/metadata/image.h>
-#include <mono/utils/mono-error.h>
+#include <mono/metadata/details/loader-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef mono_bool (*MonoStackWalk)     (MonoMethod *method, int32_t native_offset, int32_t il_offset, mono_bool managed, void* data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_get_method             (MonoImage *image, uint32_t token, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_get_method_full        (MonoImage *image, uint32_t token, MonoClass *klass,
-			     MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *
-mono_get_method_constrained (MonoImage *image, uint32_t token, MonoClass *constrained_class,
-			     MonoGenericContext *context, MonoMethod **cil_method);
-
-MONO_API void
-mono_free_method           (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_method_get_signature_full (MonoMethod *method, MonoImage *image, uint32_t token,
-				MonoGenericContext *context);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_method_get_signature  (MonoMethod *method, MonoImage *image, uint32_t token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_method_signature      (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodHeader*
-mono_method_get_header     (MonoMethod *method);
-
-MONO_API const char*
-mono_method_get_name       (MonoMethod *method);
-
-MONO_API MonoClass*
-mono_method_get_class      (MonoMethod *method);
-
-MONO_API uint32_t
-mono_method_get_token      (MonoMethod *method);
-
-MONO_API uint32_t
-mono_method_get_flags      (MonoMethod *method, uint32_t *iflags);
-
-MONO_API uint32_t
-mono_method_get_index      (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_add_internal_call     (const char *name, const void* method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_dangerous_add_raw_internal_call (const char *name, const void* method);
-
-MONO_API void*
-mono_lookup_internal_call (MonoMethod *method);
-
-MONO_API const char*
-mono_lookup_icall_symbol (MonoMethod *m);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_dllmap_insert (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_lookup_pinvoke_call (MonoMethod *method, const char **exc_class, const char **exc_arg);
-
-MONO_API void
-mono_method_get_param_names (MonoMethod *method, const char **names);
-
-MONO_API uint32_t
-mono_method_get_param_token (MonoMethod *method, int idx);
-
-MONO_API void
-mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs);
-
-MONO_API mono_bool
-mono_method_has_marshal_info (MonoMethod *method);
-
-MONO_API MonoMethod*
-mono_method_get_last_managed  (void);
-
-MONO_API void
-mono_stack_walk         (MonoStackWalk func, void* user_data);
-
-/* Use this if the IL offset is not needed: it's faster */
-MONO_API void
-mono_stack_walk_no_il   (MonoStackWalk func, void* user_data);
-
-typedef mono_bool (*MonoStackWalkAsyncSafe)     (MonoMethod *method, MonoDomain *domain, void *base_address, int offset, void* data);
-MONO_API void
-mono_stack_walk_async_safe   (MonoStackWalkAsyncSafe func, void *initial_sig_context, void* user_data);
-
-MONO_API MonoMethodHeader*
-mono_method_get_header_checked (MonoMethod *method, MonoError *error);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/loader-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/metadata.h b/src/native/public/mono/metadata/metadata.h
index c045f8c9a135e0..989d3393bab9cf 100644
--- a/src/native/public/mono/metadata/metadata.h
+++ b/src/native/public/mono/metadata/metadata.h
@@ -5,13 +5,7 @@
 #ifndef __MONO_METADATA_H__
 #define __MONO_METADATA_H__
 
-#include <mono/utils/mono-publib.h>
-
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/blob.h>
-#include <mono/metadata/row-indexes.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/object-forward.h>
+#include <mono/metadata/details/metadata-types.h>
 
 MONO_BEGIN_DECLS
 
@@ -24,196 +18,6 @@ MONO_BEGIN_DECLS
 
 #define MONO_CLASS_IS_IMPORT(c) ((mono_class_get_flags (c) & TYPE_ATTRIBUTE_IMPORT))
 
-typedef enum {
-	MONO_EXCEPTION_CLAUSE_NONE,
-	MONO_EXCEPTION_CLAUSE_FILTER,
-	MONO_EXCEPTION_CLAUSE_FINALLY,
-	MONO_EXCEPTION_CLAUSE_FAULT = 4
-} MonoExceptionEnum;
-
-typedef enum {
-	MONO_CALL_DEFAULT,
-	MONO_CALL_C,
-	MONO_CALL_STDCALL,
-	MONO_CALL_THISCALL,
-	MONO_CALL_FASTCALL,
-	MONO_CALL_VARARG = 0x05,
-	/* unused, */
-	/* unused, */
-	/* unused, */
-	MONO_CALL_UNMANAGED_MD = 0x09, /* default unmanaged calling convention, with additional attributed encoded in modopts */
-} MonoCallConvention;
-
-/* ECMA lamespec: the old spec had more info... */
-typedef enum {
-	MONO_NATIVE_BOOLEAN = 0x02, /* 4 bytes, 0 is false, != 0 is true */
-	MONO_NATIVE_I1 = 0x03,
-	MONO_NATIVE_U1 = 0x04,
-	MONO_NATIVE_I2 = 0x05,
-	MONO_NATIVE_U2 = 0x06,
-	MONO_NATIVE_I4 = 0x07,
-	MONO_NATIVE_U4 = 0x08,
-	MONO_NATIVE_I8 = 0x09,
-	MONO_NATIVE_U8 = 0x0a,
-	MONO_NATIVE_R4 = 0x0b,
-	MONO_NATIVE_R8 = 0x0c,
-	MONO_NATIVE_CURRENCY = 0x0f,
-	MONO_NATIVE_BSTR = 0x13, /* prefixed length, Unicode */
-	MONO_NATIVE_LPSTR = 0x14, /* ANSI, null terminated */
-	MONO_NATIVE_LPWSTR = 0x15, /* UNICODE, null terminated */
-	MONO_NATIVE_LPTSTR = 0x16, /* plattform dep., null terminated */
-	MONO_NATIVE_BYVALTSTR = 0x17,
-	MONO_NATIVE_IUNKNOWN = 0x19,
-	MONO_NATIVE_IDISPATCH = 0x1a,
-	MONO_NATIVE_STRUCT = 0x1b,
-	MONO_NATIVE_INTERFACE = 0x1c,
-	MONO_NATIVE_SAFEARRAY = 0x1d,
-	MONO_NATIVE_BYVALARRAY = 0x1e,
-	MONO_NATIVE_INT   = 0x1f,
-	MONO_NATIVE_UINT  = 0x20,
-	MONO_NATIVE_VBBYREFSTR  = 0x22,
-	MONO_NATIVE_ANSIBSTR  = 0x23,  /* prefixed length, ANSI */
-	MONO_NATIVE_TBSTR  = 0x24, /* prefixed length, plattform dep. */
-	MONO_NATIVE_VARIANTBOOL  = 0x25,
-	MONO_NATIVE_FUNC  = 0x26,
-	MONO_NATIVE_ASANY = 0x28,
-	MONO_NATIVE_LPARRAY = 0x2a,
-	MONO_NATIVE_LPSTRUCT = 0x2b,
-	MONO_NATIVE_CUSTOM = 0x2c,
-	MONO_NATIVE_ERROR = 0x2d,
-	// TODO: MONO_NATIVE_IINSPECTABLE = 0x2e
-	// TODO: MONO_NATIVE_HSTRING = 0x2f
-	MONO_NATIVE_UTF8STR = 0x30,
-	MONO_NATIVE_MAX = 0x50 /* no info */
-} MonoMarshalNative;
-
-/* Used only in context of SafeArray */
-typedef enum {
-	MONO_VARIANT_EMPTY = 0x00,
-	MONO_VARIANT_NULL = 0x01,
-	MONO_VARIANT_I2 = 0x02,
-	MONO_VARIANT_I4 = 0x03,
-	MONO_VARIANT_R4 = 0x04,
-	MONO_VARIANT_R8 = 0x05,
-	MONO_VARIANT_CY = 0x06,
-	MONO_VARIANT_DATE = 0x07,
-	MONO_VARIANT_BSTR = 0x08,
-	MONO_VARIANT_DISPATCH = 0x09,
-	MONO_VARIANT_ERROR = 0x0a,
-	MONO_VARIANT_BOOL = 0x0b,
-	MONO_VARIANT_VARIANT = 0x0c,
-	MONO_VARIANT_UNKNOWN = 0x0d,
-	MONO_VARIANT_DECIMAL = 0x0e,
-	MONO_VARIANT_I1 = 0x10,
-	MONO_VARIANT_UI1 = 0x11,
-	MONO_VARIANT_UI2 = 0x12,
-	MONO_VARIANT_UI4 = 0x13,
-	MONO_VARIANT_I8 = 0x14,
-	MONO_VARIANT_UI8 = 0x15,
-	MONO_VARIANT_INT = 0x16,
-	MONO_VARIANT_UINT = 0x17,
-	MONO_VARIANT_VOID = 0x18,
-	MONO_VARIANT_HRESULT = 0x19,
-	MONO_VARIANT_PTR = 0x1a,
-	MONO_VARIANT_SAFEARRAY = 0x1b,
-	MONO_VARIANT_CARRAY = 0x1c,
-	MONO_VARIANT_USERDEFINED = 0x1d,
-	MONO_VARIANT_LPSTR = 0x1e,
-	MONO_VARIANT_LPWSTR = 0x1f,
-	MONO_VARIANT_RECORD = 0x24,
-	MONO_VARIANT_FILETIME = 0x40,
-	MONO_VARIANT_BLOB = 0x41,
-	MONO_VARIANT_STREAM = 0x42,
-	MONO_VARIANT_STORAGE = 0x43,
-	MONO_VARIANT_STREAMED_OBJECT = 0x44,
-	MONO_VARIANT_STORED_OBJECT = 0x45,
-	MONO_VARIANT_BLOB_OBJECT = 0x46,
-	MONO_VARIANT_CF = 0x47,
-	MONO_VARIANT_CLSID = 0x48,
-	MONO_VARIANT_VECTOR = 0x1000,
-	MONO_VARIANT_ARRAY = 0x2000,
-	MONO_VARIANT_BYREF = 0x4000
-} MonoMarshalVariant;
-
-typedef enum {
-	MONO_MARSHAL_CONV_NONE,
-	MONO_MARSHAL_CONV_BOOL_VARIANTBOOL,
-	MONO_MARSHAL_CONV_BOOL_I4,
-	MONO_MARSHAL_CONV_STR_BSTR,
-	MONO_MARSHAL_CONV_STR_LPSTR,
-	MONO_MARSHAL_CONV_LPSTR_STR,
-	MONO_MARSHAL_CONV_LPTSTR_STR,
-	MONO_MARSHAL_CONV_STR_LPWSTR,
-	MONO_MARSHAL_CONV_LPWSTR_STR,
-	MONO_MARSHAL_CONV_STR_LPTSTR,
-	MONO_MARSHAL_CONV_STR_ANSIBSTR,
-	MONO_MARSHAL_CONV_STR_TBSTR,
-	MONO_MARSHAL_CONV_STR_BYVALSTR,
-	MONO_MARSHAL_CONV_STR_BYVALWSTR,
-	MONO_MARSHAL_CONV_SB_LPSTR,
-	MONO_MARSHAL_CONV_SB_LPTSTR,
-	MONO_MARSHAL_CONV_SB_LPWSTR,
-	MONO_MARSHAL_CONV_LPSTR_SB,
-	MONO_MARSHAL_CONV_LPTSTR_SB,
-	MONO_MARSHAL_CONV_LPWSTR_SB,
-	MONO_MARSHAL_CONV_ARRAY_BYVALARRAY,
-	MONO_MARSHAL_CONV_ARRAY_BYVALCHARARRAY,
-	MONO_MARSHAL_CONV_ARRAY_SAVEARRAY,
-	MONO_MARSHAL_CONV_ARRAY_LPARRAY,
-	MONO_MARSHAL_FREE_LPARRAY,
-	MONO_MARSHAL_CONV_OBJECT_INTERFACE,
-	MONO_MARSHAL_CONV_OBJECT_IDISPATCH,
-	MONO_MARSHAL_CONV_OBJECT_IUNKNOWN,
-	MONO_MARSHAL_CONV_OBJECT_STRUCT,
-	MONO_MARSHAL_CONV_DEL_FTN,
-	MONO_MARSHAL_CONV_FTN_DEL,
-	MONO_MARSHAL_FREE_ARRAY,
-	MONO_MARSHAL_CONV_BSTR_STR,
-	MONO_MARSHAL_CONV_SAFEHANDLE,
-	MONO_MARSHAL_CONV_HANDLEREF,
-	MONO_MARSHAL_CONV_STR_UTF8STR,
-	MONO_MARSHAL_CONV_SB_UTF8STR,
-	MONO_MARSHAL_CONV_UTF8STR_STR,
-	MONO_MARSHAL_CONV_UTF8STR_SB,
-	MONO_MARSHAL_CONV_FIXED_BUFFER,
-	MONO_MARSHAL_CONV_ANSIBSTR_STR,
-	MONO_MARSHAL_CONV_TBSTR_STR
-} MonoMarshalConv;
-
-#define MONO_MARSHAL_CONV_INVALID ((MonoMarshalConv)-1)
-
-typedef struct {
-	MonoMarshalNative native;
-	union {
-		struct {
-			MonoMarshalNative elem_type;
-			int32_t num_elem; /* -1 if not set */
-			int16_t param_num; /* -1 if not set */
-			int16_t elem_mult; /* -1 if not set */
-		} array_data;
-		struct {
-			char *custom_name;
-			char *cookie;
-			MonoImage *image;
-		} custom_data;
-		struct {
-			MonoMarshalVariant elem_type;
-			int32_t num_elem;
-		} safearray_data;
-	} data;
-} MonoMarshalSpec;
-
-MONO_API void         mono_metadata_init (void);
-
-MONO_API void         mono_metadata_decode_row (const MonoTableInfo   *t,
-				       int                    idx,
-				       uint32_t               *res,
-				       int                    res_size);
-
-MONO_API uint32_t      mono_metadata_decode_row_col (const MonoTableInfo *t,
-					   int            idx,
-					   unsigned int          col);
-
 /*
  * This macro is used to extract the size of the table encoded in
  * the size_bitfield of MonoTableInfo.
@@ -221,64 +25,6 @@ MONO_API uint32_t      mono_metadata_decode_row_col (const MonoTableInfo *t,
 #define mono_metadata_table_size(bitfield,table) ((((bitfield) >> ((table)*2)) & 0x3) + 1)
 #define mono_metadata_table_count(bitfield) ((bitfield) >> 24)
 
-MONO_API int mono_metadata_compute_size (MonoImage   *meta,
-                                int             tableindex,
-                                uint32_t        *result_bitfield);
-
-/*
- *
- */
-MONO_API const char    *mono_metadata_locate        (MonoImage *meta, int table, int idx);
-MONO_API MONO_RT_EXTERNAL_ONLY
-const char    *mono_metadata_locate_token  (MonoImage *meta, uint32_t token);
-
-MONO_API const char    *mono_metadata_string_heap   (MonoImage *meta, uint32_t table_index);
-MONO_API const char    *mono_metadata_blob_heap     (MonoImage *meta, uint32_t table_index);
-MONO_API const char    *mono_metadata_user_string   (MonoImage *meta, uint32_t table_index);
-MONO_API const char    *mono_metadata_guid_heap     (MonoImage *meta, uint32_t table_index);
-
-MONO_API uint32_t mono_metadata_typedef_from_field  (MonoImage *meta, uint32_t table_index);
-MONO_API uint32_t mono_metadata_typedef_from_method (MonoImage *meta, uint32_t table_index);
-MONO_API uint32_t mono_metadata_nested_in_typedef   (MonoImage *meta, uint32_t table_index);
-MONO_API uint32_t mono_metadata_nesting_typedef     (MonoImage *meta, uint32_t table_index, uint32_t start_index);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoClass** mono_metadata_interfaces_from_typedef (MonoImage *meta, uint32_t table_index, unsigned int *count);
-
-MONO_API uint32_t     mono_metadata_events_from_typedef     (MonoImage *meta, uint32_t table_index, unsigned int *end_idx);
-MONO_API uint32_t     mono_metadata_methods_from_event      (MonoImage *meta, uint32_t table_index, unsigned int *end);
-MONO_API uint32_t     mono_metadata_properties_from_typedef (MonoImage *meta, uint32_t table_index, unsigned int *end);
-MONO_API uint32_t     mono_metadata_methods_from_property   (MonoImage *meta, uint32_t table_index, unsigned int *end);
-MONO_API uint32_t     mono_metadata_packing_from_typedef    (MonoImage *meta, uint32_t table_index, uint32_t *packing, uint32_t *size);
-MONO_API const char* mono_metadata_get_marshal_info        (MonoImage *meta, uint32_t idx, mono_bool is_field);
-MONO_API uint32_t     mono_metadata_custom_attrs_from_index (MonoImage *meta, uint32_t cattr_index);
-
-MONO_API MonoMarshalSpec *mono_metadata_parse_marshal_spec (MonoImage *image, const char *ptr);
-
-MONO_API void mono_metadata_free_marshal_spec (MonoMarshalSpec *spec);
-
-MONO_API uint32_t     mono_metadata_implmap_from_method     (MonoImage *meta, uint32_t method_idx);
-
-MONO_API void        mono_metadata_field_info (MonoImage *meta,
-				      uint32_t       table_index,
-				      uint32_t      *offset,
-				      uint32_t      *rva,
-				      MonoMarshalSpec **marshal_spec);
-
-MONO_API uint32_t     mono_metadata_get_constant_index (MonoImage *meta, uint32_t token, uint32_t hint);
-
-/*
- * Functions to extract information from the Blobs
- */
-MONO_API uint32_t mono_metadata_decode_value     (const char            *ptr,
-                                        const char           **rptr);
-MONO_API int32_t mono_metadata_decode_signed_value (const char *ptr, const char **rptr);
-
-MONO_API uint32_t mono_metadata_decode_blob_size (const char            *ptr,
-                                        const char           **rptr);
-
-MONO_API void mono_metadata_encode_value (uint32_t value, char *bug, char **endbuf);
-
 #define MONO_OFFSET_IN_CLAUSE(clause,offset) \
 	((clause)->try_offset <= (offset) && (offset) < ((clause)->try_offset + (clause)->try_len))
 #define MONO_OFFSET_IN_HANDLER(clause,offset) \
@@ -286,200 +32,6 @@ MONO_API void mono_metadata_encode_value (uint32_t value, char *bug, char **endb
 #define MONO_OFFSET_IN_FILTER(clause,offset) \
 	((clause)->flags == MONO_EXCEPTION_CLAUSE_FILTER && (clause)->data.filter_offset <= (offset) && (offset) < ((clause)->handler_offset))
 
-typedef struct {
-	uint32_t flags;
-	uint32_t try_offset;
-	uint32_t try_len;
-	uint32_t handler_offset;
-	uint32_t handler_len;
-	union {
-		uint32_t filter_offset;
-		MonoClass *catch_class;
-	} data;
-} MonoExceptionClause;
-
-typedef struct _MonoType MonoType;
-typedef struct _MonoGenericInst MonoGenericInst;
-typedef struct _MonoGenericClass MonoGenericClass;
-typedef struct _MonoGenericContext MonoGenericContext;
-typedef struct _MonoGenericContainer MonoGenericContainer;
-typedef struct _MonoGenericParam MonoGenericParam;
-typedef struct _MonoArrayType MonoArrayType;
-typedef struct _MonoMethodSignature MonoMethodSignature;
-
-/* FIXME: Keeping this name alive for now, since it is part of the exposed API, even though no entrypoint uses it.  */
-typedef struct invalid_name MonoGenericMethod;
-
-typedef struct {
-	unsigned int required : 1;
-	unsigned int token    : 31;
-} MonoCustomMod;
-
-typedef struct _MonoCustomModContainer {
-	uint8_t count; /* max 64 modifiers follow at the end */
-	MonoImage *image; /* Image containing types in modifiers array */
-	MonoCustomMod modifiers [1]; /* Actual length is count */
-} MonoCustomModContainer;
-
-struct _MonoArrayType {
-	MonoClass *eklass;
-	// Number of dimensions of the array
-	uint8_t rank;
-
-	// Arrays recording known upper and lower index bounds for each dimension
-	uint8_t numsizes;
-	uint8_t numlobounds;
-	int *sizes;
-	int *lobounds;
-};
-
-typedef struct _MonoMethodHeader MonoMethodHeader;
-
-typedef enum {
-	MONO_PARSE_TYPE,
-	MONO_PARSE_MOD_TYPE,
-	MONO_PARSE_LOCAL,
-	MONO_PARSE_PARAM,
-	MONO_PARSE_RET,
-	MONO_PARSE_FIELD
-} MonoParseTypeMode;
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_type_is_byref       (MonoType *type);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_type_get_type       (MonoType *type);
-
-/* For MONO_TYPE_FNPTR */
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*
-mono_type_get_signature  (MonoType *type);
-
-/* For MONO_TYPE_CLASS, VALUETYPE */
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_type_get_class      (MonoType *type);
-
-MONO_API MonoArrayType*
-mono_type_get_array_type (MonoType *type);
-
-/* For MONO_TYPE_PTR */
-MONO_API MonoType*
-mono_type_get_ptr_type (MonoType *type);
-
-MONO_API MonoClass*
-mono_type_get_modifiers  (MonoType *type, mono_bool *is_required, void **iter);
-
-MONO_API mono_bool mono_type_is_struct    (MonoType *type);
-MONO_API mono_bool mono_type_is_void      (MonoType *type);
-MONO_API mono_bool mono_type_is_pointer   (MonoType *type);
-MONO_API mono_bool mono_type_is_reference (MonoType *type);
-MONO_API mono_bool mono_type_is_generic_parameter (MonoType *type);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_signature_get_return_type (MonoMethodSignature *sig);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType*
-mono_signature_get_params      (MonoMethodSignature *sig, void **iter);
-
-MONO_API uint32_t
-mono_signature_get_param_count (MonoMethodSignature *sig);
-
-MONO_API uint32_t
-mono_signature_get_call_conv   (MonoMethodSignature *sig);
-
-MONO_API int
-mono_signature_vararg_start    (MonoMethodSignature *sig);
-
-MONO_API mono_bool
-mono_signature_is_instance     (MonoMethodSignature *sig);
-
-MONO_API mono_bool
-mono_signature_explicit_this   (MonoMethodSignature *sig);
-
-MONO_API mono_bool
-mono_signature_param_is_out    (MonoMethodSignature *sig, int param_num);
-
-MONO_API uint32_t     mono_metadata_parse_typedef_or_ref (MonoImage      *m,
-                                                const char      *ptr,
-                                                const char     **rptr);
-MONO_API int            mono_metadata_parse_custom_mod  (MonoImage      *m,
-						MonoCustomMod   *dest,
-						const char      *ptr,
-						const char     **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArrayType *mono_metadata_parse_array       (MonoImage      *m,
-						const char      *ptr,
-						const char     **rptr);
-MONO_API void           mono_metadata_free_array        (MonoArrayType     *array);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoType      *mono_metadata_parse_type        (MonoImage      *m,
-						MonoParseTypeMode  mode,
-						short              opt_attrs,
-						const char        *ptr,
-						const char       **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType      *mono_metadata_parse_param       (MonoImage      *m,
-						const char      *ptr,
-						const char      **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType      *mono_metadata_parse_field_type  (MonoImage      *m,
-		                                short            field_flags,
-						const char      *ptr,
-						const char      **rptr);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType      *mono_type_create_from_typespec  (MonoImage        *image,
-					        uint32_t           type_spec);
-MONO_API void           mono_metadata_free_type         (MonoType        *type);
-MONO_API int            mono_type_size                  (MonoType        *type,
-						int             *alignment);
-MONO_API int            mono_type_stack_size            (MonoType        *type,
-						int             *alignment);
-
-MONO_API mono_bool       mono_type_generic_inst_is_valuetype      (MonoType *type);
-MONO_API mono_bool       mono_metadata_generic_class_is_valuetype (MonoGenericClass *gclass);
-
-MONO_API unsigned int          mono_metadata_type_hash         (MonoType *t1);
-MONO_API mono_bool       mono_metadata_type_equal        (MonoType *t1, MonoType *t2);
-
-MONO_API MonoMethodSignature  *mono_metadata_signature_alloc (MonoImage *image, uint32_t nparams);
-
-MONO_API MonoMethodSignature  *mono_metadata_signature_dup (MonoMethodSignature *sig);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethodSignature  *mono_metadata_parse_signature (MonoImage *image,
-						     uint32_t    token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethodSignature  *mono_metadata_parse_method_signature (MonoImage            *m,
-                                                            int                    def,
-                                                            const char            *ptr,
-                                                            const char           **rptr);
-MONO_API void                  mono_metadata_free_method_signature  (MonoMethodSignature   *method);
-
-MONO_API mono_bool          mono_metadata_signature_equal (MonoMethodSignature *sig1,
-						 MonoMethodSignature *sig2);
-
-MONO_API unsigned int             mono_signature_hash (MonoMethodSignature *sig);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoMethodHeader *mono_metadata_parse_mh (MonoImage *m, const char *ptr);
-MONO_API void              mono_metadata_free_mh  (MonoMethodHeader *mh);
-
-/* MonoMethodHeader accessors */
-MONO_API const unsigned char*
-mono_method_header_get_code (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack);
-
-MONO_API MonoType**
-mono_method_header_get_locals (MonoMethodHeader *header, uint32_t* num_locals, mono_bool *init_locals);
-
-MONO_API int
-mono_method_header_get_num_clauses (MonoMethodHeader *header);
-
-MONO_API int
-mono_method_header_get_clauses (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause);
-
-MONO_API uint32_t
-mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec,
-			mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv);
-
 /*
  * Makes a token based on a table and an index
  */
@@ -498,24 +50,9 @@ mono_type_to_unmanaged (MonoType *type, MonoMarshalSpec *mspec,
 
 #define mono_metadata_token_code(token) ((token) & 0xff000000)
 
-MONO_API uint32_t mono_metadata_token_from_dor (uint32_t dor_index);
-
-MONO_API char *mono_guid_to_string (const uint8_t *guid);
-
-MONO_API char *mono_guid_to_string_minimal (const uint8_t *guid);
-
-MONO_API uint32_t mono_metadata_declsec_from_index (MonoImage *meta, uint32_t idx);
-
-MONO_API uint32_t mono_metadata_translate_token_index (MonoImage *image, int table, uint32_t idx);
-
-MONO_API void    mono_metadata_decode_table_row (MonoImage *image, int table,
-				       int                    idx,
-				       uint32_t               *res,
-				       int                    res_size);
-
-MONO_API uint32_t      mono_metadata_decode_table_row_col (MonoImage *image, int table,
-					   int            idx,
-					   unsigned int          col);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/metadata-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/mono-config.h b/src/native/public/mono/metadata/mono-config.h
index 91cdccd38e39d1..517e393611bf7d 100644
--- a/src/native/public/mono/metadata/mono-config.h
+++ b/src/native/public/mono/metadata/mono-config.h
@@ -8,29 +8,13 @@
 #ifndef __MONO_METADATA_CONFIG_H__
 #define __MONO_METADATA_CONFIG_H__
 
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/image.h>
+#include <mono/metadata/details/mono-config-types.h>
 
 MONO_BEGIN_DECLS
 
-MONO_API const char *mono_config_get_os (void);
-MONO_API const char *mono_config_get_cpu (void);
-MONO_API const char *mono_config_get_wordsize (void);
-
-MONO_API const char* mono_get_config_dir (void);
-MONO_API void        mono_set_config_dir (const char *dir);
-
-MONO_API const char* mono_get_machine_config (void);
-
-MONO_API void mono_config_cleanup      (void);
-MONO_API void mono_config_parse        (const char *filename);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_config_for_assembly (MonoImage *assembly);
-MONO_API void mono_config_parse_memory (const char *buffer);
-
-MONO_API const char* mono_config_string_for_assembly_file (const char *filename);
-
-MONO_API void mono_config_set_server_mode (mono_bool server_mode);
-MONO_API mono_bool mono_config_is_server_mode (void);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/mono-config-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/mono-debug.h b/src/native/public/mono/metadata/mono-debug.h
index 2fe6a3394afda1..e7ab60f1095e0e 100644
--- a/src/native/public/mono/metadata/mono-debug.h
+++ b/src/native/public/mono/metadata/mono-debug.h
@@ -7,224 +7,13 @@
 #ifndef __MONO_DEBUG_H__
 #define __MONO_DEBUG_H__
 
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/appdomain.h>
+#include <mono/metadata/details/mono-debug-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef struct _MonoSymbolTable			MonoSymbolTable;
-typedef struct _MonoDebugDataTable		MonoDebugDataTable;
-
-typedef struct _MonoSymbolFile			MonoSymbolFile;
-typedef struct _MonoPPDBFile			MonoPPDBFile;
-
-typedef struct _MonoDebugHandle			MonoDebugHandle;
-
-typedef struct _MonoDebugLineNumberEntry	MonoDebugLineNumberEntry;
-
-typedef struct _MonoDebugVarInfo		MonoDebugVarInfo;
-typedef struct _MonoDebugMethodJitInfo		MonoDebugMethodJitInfo;
-typedef struct _MonoDebugMethodAddress		MonoDebugMethodAddress;
-typedef struct _MonoDebugMethodAddressList	MonoDebugMethodAddressList;
-typedef struct _MonoDebugClassEntry		MonoDebugClassEntry;
-
-typedef struct _MonoDebugMethodInfo		MonoDebugMethodInfo;
-typedef struct _MonoDebugLocalsInfo		MonoDebugLocalsInfo;
-typedef struct _MonoDebugMethodAsyncInfo	MonoDebugMethodAsyncInfo;
-typedef struct _MonoDebugSourceLocation		MonoDebugSourceLocation;
-
-typedef struct _MonoDebugList			MonoDebugList;
-
-typedef enum {
-	MONO_DEBUG_FORMAT_NONE,
-	MONO_DEBUG_FORMAT_MONO,
-	/* Deprecated, the mdb debugger is not longer supported. */
-	MONO_DEBUG_FORMAT_DEBUGGER
-} MonoDebugFormat;
-
-/*
- * NOTE:
- * We intentionally do not use GList here since the debugger needs to know about
- * the layout of the fields.
-*/
-struct _MonoDebugList {
-	MonoDebugList *next;
-	const void* data;
-};
-
-struct _MonoSymbolTable {
-	uint64_t magic;
-	uint32_t version;
-	uint32_t total_size;
-
-	/*
-	 * Corlib and metadata info.
-	 */
-	MonoDebugHandle *corlib;
-	MonoDebugDataTable *global_data_table;
-	MonoDebugList *data_tables;
-
-	/*
-	 * The symbol files.
-	 */
-	MonoDebugList *symbol_files;
-};
-
-struct _MonoDebugHandle {
-	uint32_t index;
-	char *image_file;
-	MonoImage *image;
-	MonoDebugDataTable *type_table;
-	MonoSymbolFile *symfile;
-	MonoPPDBFile *ppdb;
-};
-
-struct _MonoDebugMethodJitInfo {
-	const mono_byte *code_start;
-	uint32_t code_size;
-	uint32_t prologue_end;
-	uint32_t epilogue_begin;
-	const mono_byte *wrapper_addr;
-	uint32_t num_line_numbers;
-	MonoDebugLineNumberEntry *line_numbers;
-	uint32_t has_var_info;
-	uint32_t num_params;
-	MonoDebugVarInfo *this_var;
-	MonoDebugVarInfo *params;
-	uint32_t num_locals;
-	MonoDebugVarInfo *locals;
-	MonoDebugVarInfo *gsharedvt_info_var;
-	MonoDebugVarInfo *gsharedvt_locals_var;
-};
-
-struct _MonoDebugMethodAddressList {
-	uint32_t size;
-	uint32_t count;
-	mono_byte data [MONO_ZERO_LEN_ARRAY];
-};
-
-struct _MonoDebugSourceLocation {
-	char *source_file;
-	uint32_t row, column;
-	uint32_t il_offset;
-};
-
-MONO_API mono_bool mono_debug_enabled (void);
-
-/*
- * These bits of the MonoDebugLocalInfo's "index" field are flags specifying
- * where the variable is actually stored.
- *
- * See relocate_variable() in debug-symfile.c for more info.
- */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_FLAGS		0xf0000000
-
-/* The variable is in register "index". */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_REGISTER		0
-
-/* The variable is at offset "offset" from register "index". */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET		0x10000000
-
-/* The variable is in the two registers "offset" and "index". */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_TWO_REGISTERS	0x20000000
-
-/* The variable is dead. */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_DEAD		0x30000000
-
-/* Same as REGOFFSET, but do an indirection */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_REGOFFSET_INDIR		0x40000000
-
-/* gsharedvt local */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_GSHAREDVT_LOCAL		0x50000000
-
-/* variable is a vt address */
-#define MONO_DEBUG_VAR_ADDRESS_MODE_VTADDR		0x60000000
-
-struct _MonoDebugVarInfo {
-	uint32_t index;
-	uint32_t offset;
-	uint32_t size;
-	uint32_t begin_scope;
-	uint32_t end_scope;
-	MonoType *type;
-};
-
-#define MONO_DEBUGGER_MAJOR_VERSION			81
-#define MONO_DEBUGGER_MINOR_VERSION			6
-#define MONO_DEBUGGER_MAGIC				0x7aff65af4253d427ULL
-
-MONO_API void mono_debug_init (MonoDebugFormat format);
-MONO_API void mono_debug_open_image_from_memory (MonoImage *image, const mono_byte *raw_contents, int size);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_debug_cleanup (void);
-
-MONO_API void mono_debug_close_image (MonoImage *image);
-
-MONO_API void mono_debug_domain_unload (MonoDomain *domain);
-MONO_API void mono_debug_domain_create (MonoDomain *domain);
-
-MONO_API MonoDebugMethodAddress *
-mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain);
-
-MONO_API void
-mono_debug_remove_method (MonoMethod *method, MonoDomain *domain);
-
-MONO_API MonoDebugMethodInfo *
-mono_debug_lookup_method (MonoMethod *method);
-
-MONO_API MonoDebugMethodAddressList *
-mono_debug_lookup_method_addresses (MonoMethod *method);
-
-MONO_API MonoDebugMethodJitInfo*
-mono_debug_find_method (MonoMethod *method, MonoDomain *domain);
-
-MONO_API MonoDebugHandle *
-mono_debug_get_handle (MonoImage *image);
-
-MONO_API void
-mono_debug_free_method_jit_info (MonoDebugMethodJitInfo *jit);
-
-
-MONO_API void
-mono_debug_add_delegate_trampoline (void* code, int size);
-
-MONO_API MonoDebugLocalsInfo*
-mono_debug_lookup_locals (MonoMethod *method);
-
-MONO_API MonoDebugMethodAsyncInfo*
-mono_debug_lookup_method_async_debug_info (MonoMethod *method);
-
-MONO_API
-MonoDebugSourceLocation *
-mono_debug_method_lookup_location (MonoDebugMethodInfo *minfo, int il_offset);
-
-/*
- * Line number support.
- */
-
-MONO_API MonoDebugSourceLocation *
-mono_debug_lookup_source_location (MonoMethod *method, uint32_t address, MonoDomain *domain);
-
-MONO_API int32_t
-mono_debug_il_offset_from_address (MonoMethod *method, MonoDomain *domain, uint32_t native_offset);
-
-MONO_API void
-mono_debug_free_source_location (MonoDebugSourceLocation *location);
-
-MONO_API char *
-mono_debug_print_stack_frame (MonoMethod *method, uint32_t native_offset, MonoDomain *domain);
-
-/*
- * Mono Debugger support functions
- *
- * These methods are used by the JIT while running inside the Mono Debugger.
- */
-
-MONO_API int             mono_debugger_method_has_breakpoint       (MonoMethod *method);
-MONO_API int             mono_debugger_insert_breakpoint           (const char *method_name, mono_bool include_namespace);
-
-MONO_API void mono_set_is_debugger_attached (mono_bool attached);
-MONO_API mono_bool mono_is_debugger_attached (void);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/mono-debug-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/mono-gc.h b/src/native/public/mono/metadata/mono-gc.h
index 7e7bc5dda2661d..b89b3fb6b5a9cd 100644
--- a/src/native/public/mono/metadata/mono-gc.h
+++ b/src/native/public/mono/metadata/mono-gc.h
@@ -6,126 +6,13 @@
 #ifndef __METADATA_MONO_GC_H__
 #define __METADATA_MONO_GC_H__
 
-#include <mono/metadata/object.h>
+#include <mono/metadata/details/mono-gc-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef int (*MonoGCReferences) (MonoObject *obj, MonoClass *klass, uintptr_t size, uintptr_t num, MonoObject **refs, uintptr_t *offsets, void *data);
-
-/**
- * This enum is used by the profiler API when reporting root registration.
- */
-typedef enum {
-	/**
-	 * Roots external to Mono. Embedders may only use this value.
-	 */
-	MONO_ROOT_SOURCE_EXTERNAL = 0,
-	/**
-	 * Thread call stack.
-	 *
-	 * The \c key parameter is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_STACK = 1,
-	/**
-	 * Roots in the finalizer queue. This is a pseudo-root.
-	 */
-	MONO_ROOT_SOURCE_FINALIZER_QUEUE = 2,
-	/**
-	 * Managed \c static variables.
-	 *
-	 * The \c key parameter is a \c MonoVTable pointer.
-	 */
-	MONO_ROOT_SOURCE_STATIC = 3,
-	/**
-	 * Managed \c static variables with \c ThreadStaticAttribute.
-	 *
-	 * The \c key parameter is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_THREAD_STATIC = 4,
-	/**
-	 * Managed \c static variables with \c ContextStaticAttribute.
-	 *
-	 * The \c key parameter is a \c MonoAppContext pointer.
-	 */
-	MONO_ROOT_SOURCE_CONTEXT_STATIC = 5,
-	/**
-	 * \c GCHandle structures.
-	 */
-	MONO_ROOT_SOURCE_GC_HANDLE = 6,
-	/**
-	 * Roots in the just-in-time compiler.
-	 */
-	MONO_ROOT_SOURCE_JIT = 7,
-	/**
-	 * Roots in the threading subsystem.
-	 *
-	 * The \c key parameter, if not \c NULL, is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_THREADING = 8,
-	/**
-	 * Roots in application domains.
-	 *
-	 * The \c key parameter, if not \c NULL, is a \c MonoDomain pointer.
-	 */
-	MONO_ROOT_SOURCE_DOMAIN = 9,
-	/**
-	 * Roots in reflection code.
-	 *
-	 * The \c key parameter, if not \c NULL, is a \c MonoVTable pointer.
-	 */
-	MONO_ROOT_SOURCE_REFLECTION = 10,
-	/**
-	 * Roots from P/Invoke or other marshaling infrastructure.
-	 */
-	MONO_ROOT_SOURCE_MARSHAL = 11,
-	/**
-	 * Roots in the thread pool data structures.
-	 */
-	MONO_ROOT_SOURCE_THREAD_POOL = 12,
-	/**
-	 * Roots in the debugger agent.
-	 */
-	MONO_ROOT_SOURCE_DEBUGGER = 13,
-	/**
-	 * Roots in the runtime handle stack. This is a pseudo-root.
-	 *
-	 * The \c key parameter is a thread ID as a \c uintptr_t.
-	 */
-	MONO_ROOT_SOURCE_HANDLE = 14,
-	/**
-	 * Roots in the ephemeron arrays. This is a pseudo-root.
-	 */
-	MONO_ROOT_SOURCE_EPHEMERON = 15,
-	/**
-	 * Roots in the toggleref arrays. This is a pseudo-root.
-	 */
-	MONO_ROOT_SOURCE_TOGGLEREF = 16,
-} MonoGCRootSource;
-
-typedef enum {
-	MONO_GC_HANDLE_TYPE_MIN = 0,
-	MONO_GC_HANDLE_WEAK = MONO_GC_HANDLE_TYPE_MIN,
-	MONO_GC_HANDLE_WEAK_TRACK_RESURRECTION,
-	MONO_GC_HANDLE_NORMAL,
-	MONO_GC_HANDLE_PINNED,
-	MONO_GC_HANDLE_TYPE_MAX,
-} MonoGCHandleType;
-
-MONO_API void   mono_gc_collect         (int generation);
-MONO_API int    mono_gc_max_generation  (void);
-MONO_API int    mono_gc_get_generation  (MonoObject *object);
-MONO_API int    mono_gc_collection_count (int generation);
-MONO_API int64_t mono_gc_get_generation_size (int generation);
-MONO_API int64_t mono_gc_get_used_size   (void);
-MONO_API int64_t mono_gc_get_heap_size   (void);
-MONO_API MonoBoolean mono_gc_pending_finalizers (void);
-MONO_API void     mono_gc_finalize_notify    (void);
-MONO_API int    mono_gc_invoke_finalizers (void);
-/* heap walking is only valid in the pre-stop-world event callback */
-MONO_API int    mono_gc_walk_heap        (int flags, MonoGCReferences callback, void *data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_gc_init_finalizer_thread (void);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/mono-gc-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/mono-private-unstable.h b/src/native/public/mono/metadata/mono-private-unstable.h
index 203ef008ad486a..1354c09d6d632b 100644
--- a/src/native/public/mono/metadata/mono-private-unstable.h
+++ b/src/native/public/mono/metadata/mono-private-unstable.h
@@ -15,31 +15,14 @@
 #include <mono/utils/mono-forward.h>
 #include <mono/utils/mono-publib.h>
 
-typedef MonoGCHandle MonoAssemblyLoadContextGCHandle;
+#include <mono/metadata/details/mono-private-unstable-types.h>
 
-MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *
-mono_assembly_load_full_alc (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status);
+MONO_BEGIN_DECLS
 
-MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *
-mono_image_open_from_data_alc (MonoAssemblyLoadContextGCHandle alc_gchandle, char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, const char *name);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/mono-private-unstable-functions.h>
+#undef MONO_API_FUNCTION
 
-typedef MonoAssembly * (*MonoAssemblyPreLoadFuncV3) (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, char **assemblies_path, void *user_data, MonoError *error);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_install_assembly_preload_hook_v3 (MonoAssemblyPreLoadFuncV3 func, void *user_data, mono_bool append);
-
-// This can point at NULL before the default ALC is initialized
-MONO_API MONO_RT_EXTERNAL_ONLY MonoAssemblyLoadContextGCHandle
-mono_alc_get_default_gchandle (void);
-
-typedef struct _MonoBundledSatelliteAssembly MonoBundledSatelliteAssembly;
-
-MONO_API void
-mono_register_bundled_satellite_assemblies (const MonoBundledSatelliteAssembly **assemblies);
-
-MONO_API MonoBundledSatelliteAssembly *
-mono_create_new_bundled_satellite_assembly (const char *name, const char *culture, const unsigned char *data, unsigned int size);
-
-typedef void * (*PInvokeOverrideFn) (const char *libraryName, const char *entrypointName);
+MONO_END_DECLS
 
 #endif /*__MONO_METADATA_MONO_PRIVATE_UNSTABLE_H__*/
diff --git a/src/native/public/mono/metadata/object-forward.h b/src/native/public/mono/metadata/object-forward.h
index 010dc8b0f76e48..d8cca573e52ced 100644
--- a/src/native/public/mono/metadata/object-forward.h
+++ b/src/native/public/mono/metadata/object-forward.h
@@ -8,7 +8,7 @@
 #ifndef __MONO_OBJECT_FORWARD_H__
 #define __MONO_OBJECT_FORWARD_H__
 
-#include <mono/utils/mono-publib.h>
+#include <mono/utils/details/mono-publib-types.h>
 
 typedef struct _MonoClass MonoClass;
 typedef struct _MonoImage MonoImage;
diff --git a/src/native/public/mono/metadata/object.h b/src/native/public/mono/metadata/object.h
index 2186fa802c448f..434455a6656151 100644
--- a/src/native/public/mono/metadata/object.h
+++ b/src/native/public/mono/metadata/object.h
@@ -5,37 +5,13 @@
 #ifndef _MONO_CLI_OBJECT_H_
 #define _MONO_CLI_OBJECT_H_
 
-#include <mono/utils/mono-forward.h>
-#include <mono/metadata/object-forward.h>
-#include <mono/metadata/class.h>
-#include <mono/utils/mono-error.h>
+#include <mono/metadata/details/object-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef struct _MonoString MONO_RT_MANAGED_ATTR MonoString;
-typedef struct _MonoArray MONO_RT_MANAGED_ATTR MonoArray;
-typedef struct _MonoReflectionMethod MONO_RT_MANAGED_ATTR MonoReflectionMethod;
-typedef struct _MonoReflectionModule MONO_RT_MANAGED_ATTR MonoReflectionModule;
-typedef struct _MonoReflectionField MONO_RT_MANAGED_ATTR MonoReflectionField;
-typedef struct _MonoReflectionProperty MONO_RT_MANAGED_ATTR MonoReflectionProperty;
-typedef struct _MonoReflectionEvent MONO_RT_MANAGED_ATTR MonoReflectionEvent;
-typedef struct _MonoReflectionType MONO_RT_MANAGED_ATTR MonoReflectionType;
-typedef struct _MonoDelegate MONO_RT_MANAGED_ATTR MonoDelegate;
-typedef struct _MonoThreadsSync MonoThreadsSync;
-typedef struct _MonoInternalThread MONO_RT_MANAGED_ATTR MonoThread;
-typedef struct _MonoDynamicAssembly MonoDynamicAssembly;
-typedef struct _MonoDynamicImage MonoDynamicImage;
-typedef struct _MonoReflectionMethodBody MONO_RT_MANAGED_ATTR MonoReflectionMethodBody;
-typedef struct _MonoAppContext MONO_RT_MANAGED_ATTR MonoAppContext;
-
-struct _MonoObject {
-	MonoVTable *vtable;
-	MonoThreadsSync *synchronisation;
-};
-
-typedef MonoObject* (*MonoInvokeFunc)	     (MonoMethod *method, void *obj, void **params, MonoObject **exc, MonoError *error);
-typedef void*    (*MonoCompileFunc)	     (MonoMethod *method);
-typedef void	    (*MonoMainThreadFunc)    (void* user_data);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/object-functions.h>
+#undef MONO_API_FUNCTION
 
 #define MONO_OBJECT_SETREF(obj,fieldname,value) do {	\
 		mono_gc_wbarrier_set_field ((MonoObject*)(obj), &((obj)->fieldname), (MonoObject*)value);	\
@@ -67,334 +43,6 @@ typedef void	    (*MonoMainThreadFunc)    (void* user_data);
 		mono_gc_wbarrier_arrayref_copy (__p, __s, (count));	\
 	} while (0)
 
-MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *mono_string_chars  (MonoString *s);
-MONO_API MONO_RT_EXTERNAL_ONLY int            mono_string_length (MonoString *s);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_new		    (MonoDomain *domain, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_specific    (MonoVTable *vtable);
-
-/* can be used for classes without finalizer in non-profiling mode */
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_fast	    (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_alloc_specific (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject *
-mono_object_new_from_token  (MonoDomain *domain, MonoImage *image, uint32_t token);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*
-mono_array_new		    (MonoDomain *domain, MonoClass *eclass, uintptr_t n);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*
-mono_array_new_full	    (MonoDomain *domain, MonoClass *array_class,
-			     uintptr_t *lengths, intptr_t *lower_bounds);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray *
-mono_array_new_specific	    (MonoVTable *vtable, uintptr_t n);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*
-mono_array_clone	    (MonoArray *array);
-
-MONO_API MONO_RT_EXTERNAL_ONLY char*
-mono_array_addr_with_size   (MonoArray *array, int size, uintptr_t idx);
-
-MONO_API MONO_RT_EXTERNAL_ONLY uintptr_t
-mono_array_length           (MonoArray *array);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString*
-mono_string_empty	      (MonoDomain *domain);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_empty_wrapper   (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_utf16	    (MonoDomain *domain, const mono_unichar2 *text, int32_t len);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_size	    (MonoDomain *domain, int32_t len);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_ldstr		    (MonoDomain *domain, MonoImage *image, uint32_t str_index);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString*
-mono_string_is_interned	    (MonoString *str);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_intern	    (MonoString *str);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new		    (MonoDomain *domain, const char *text);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString*
-mono_string_new_wrapper	    (const char *text);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_len	    (MonoDomain *domain, const char *text, unsigned int length);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString*
-mono_string_new_utf32	    (MonoDomain *domain, const mono_unichar4 *text, int32_t len);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-char *
-mono_string_to_utf8	    (MonoString *string_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY char *
-mono_string_to_utf8_checked (MonoString *string_obj, MonoError *error);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *
-mono_string_to_utf16	    (MonoString *string_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar4 *
-mono_string_to_utf32	    (MonoString *string_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString *
-mono_string_from_utf16	    (/*const*/ mono_unichar2 *data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoString *
-mono_string_from_utf32	    (/*const*/ mono_unichar4 *data);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_string_equal           (MonoString *s1, MonoString *s2);
-
-MONO_API MONO_RT_EXTERNAL_ONLY unsigned int
-mono_string_hash            (MonoString *s);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_object_hash            (MonoObject* obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoString *
-mono_object_to_string (MonoObject *obj, MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_value_box		    (MonoDomain *domain, MonoClass *klass, void* val);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_value_copy             (void* dest, /*const*/ void* src, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_value_copy_array       (MonoArray *dest, int dest_idx, void* src, int count);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoVTable*
-mono_object_get_vtable      (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*
-mono_object_get_domain      (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_object_get_class       (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_object_unbox	    (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_clone	    (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_isinst	    (MonoObject *obj, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_isinst_mbyref   (MonoObject *obj, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_object_castclass_mbyref (MonoObject *obj, MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_monitor_try_enter       (MonoObject *obj, uint32_t ms);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_monitor_enter           (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_monitor_enter_v4        (MonoObject *obj, char *lock_taken);
-
-MONO_API MONO_RT_EXTERNAL_ONLY unsigned int
-mono_object_get_size         (MonoObject *o);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_monitor_exit            (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_raise_exception	    (MonoException *ex);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_runtime_set_pending_exception (MonoException *exc, mono_bool overwrite);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_reraise_exception	    (MonoException *ex);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_object_init    (MonoObject *this_obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_class_init	    (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*
-mono_vtable_domain          (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*
-mono_vtable_class           (MonoVTable *vtable);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_object_get_virtual_method (MonoObject *obj, MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_runtime_invoke	    (MonoMethod *method, void *obj, void **params,
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_get_delegate_invoke    (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_get_delegate_begin_invoke (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*
-mono_get_delegate_end_invoke (MonoClass *klass);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_runtime_delegate_invoke (MonoObject *delegate, void **params,
-			      MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_runtime_invoke_array   (MonoMethod *method, void *obj, MonoArray *params,
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_method_get_unmanaged_thunk (MonoMethod *method);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*
-mono_runtime_get_main_args  (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_runtime_exec_managed_code (MonoDomain *domain,
-				MonoMainThreadFunc main_func,
-				void* main_args);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_runtime_run_main	    (MonoMethod *method, int argc, char* argv[],
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_runtime_exec_main	    (MonoMethod *method, MonoArray *args,
-			     MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY int
-mono_runtime_set_main_args  (int argc, char* argv[]);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void*
-mono_load_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void **res);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_load_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_store_remote_field (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void* val);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_store_remote_field_new (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_unhandled_exception    (MonoObject *exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_print_unhandled_exception (MonoObject *exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-void*
-mono_compile_method	   (MonoMethod *method);
-
-/* accessors for fields and properties */
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_set_value (MonoObject *obj, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_static_set_value (MonoVTable *vt, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_get_value (MonoObject *obj, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_field_static_get_value (MonoVTable *vt, MonoClassField *field, void *value);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *
-mono_field_get_value_object (MonoDomain *domain, MonoClassField *field, MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_property_set_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*
-mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObject **exc);
-
-/* GC handles support
- *
- * A handle can be created to refer to a managed object and either prevent it
- * from being garbage collected or moved or to be able to know if it has been
- * collected or not (weak references).
- * mono_gchandle_new () is used to prevent an object from being garbage collected
- * until mono_gchandle_free() is called. Use a TRUE value for the pinned argument to
- * prevent the object from being moved (this should be avoided as much as possible
- * and this should be used only for shorts periods of time or performance will suffer).
- * To create a weakref use mono_gchandle_new_weakref (): track_resurrection should
- * usually be false (see the GC docs for more details).
- * mono_gchandle_get_target () can be used to get the object referenced by both kinds
- * of handle: for a weakref handle, if an object has been collected, it will return NULL.
- */
-MONO_API MONO_RT_EXTERNAL_ONLY uint32_t     mono_gchandle_new         (MonoObject *obj, mono_bool pinned);
-MONO_API MONO_RT_EXTERNAL_ONLY uint32_t     mono_gchandle_new_weakref (MonoObject *obj, mono_bool track_resurrection);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*  mono_gchandle_get_target  (uint32_t gchandle);
-MONO_API MONO_RT_EXTERNAL_ONLY void         mono_gchandle_free        (uint32_t gchandle);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoGCHandle mono_gchandle_new_v2         (MonoObject *obj, mono_bool pinned);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoGCHandle mono_gchandle_new_weakref_v2 (MonoObject *obj, mono_bool track_resurrection);
-MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*  mono_gchandle_get_target_v2  (MonoGCHandle gchandle);
-MONO_API MONO_RT_EXTERNAL_ONLY void         mono_gchandle_free_v2        (MonoGCHandle gchandle);
-
-/* Reference queue support
- *
- * A reference queue is used to get notifications of when objects are collected.
- * Call mono_gc_reference_queue_new to create a new queue and pass the callback that
- * will be invoked when registered objects are collected.
- * Call mono_gc_reference_queue_add to register a pair of objects and data within a queue.
- * The callback will be triggered once an object is both unreachable and finalized.
- */
-
-typedef void (*mono_reference_queue_callback) (void *user_data);
-typedef struct _MonoReferenceQueue MonoReferenceQueue;
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoReferenceQueue* mono_gc_reference_queue_new (mono_reference_queue_callback callback);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_reference_queue_free (MonoReferenceQueue *queue);
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool mono_gc_reference_queue_add (MonoReferenceQueue *queue, MonoObject *obj, void *user_data);
-
-/* GC write barriers support */
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_set_field     (MonoObject *obj, void* field_ptr, MonoObject* value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_set_arrayref  (MonoArray *arr, void* slot_ptr, MonoObject* value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_arrayref_copy (void* dest_ptr, /*const*/ void* src_ptr, int count);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_store (void* ptr, MonoObject* value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_store_atomic (void *ptr, MonoObject *value);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_generic_nostore (void* ptr);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_value_copy    (void* dest, /*const*/ void* src, int count, MonoClass *klass);
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wbarrier_object_copy   (MonoObject* obj, MonoObject *src);
-
 MONO_END_DECLS
 
 #endif
diff --git a/src/native/public/mono/metadata/opcodes.h b/src/native/public/mono/metadata/opcodes.h
index bcaf099a44bc10..994d70f2a51b5c 100644
--- a/src/native/public/mono/metadata/opcodes.h
+++ b/src/native/public/mono/metadata/opcodes.h
@@ -14,69 +14,14 @@
  * (C) 2002 Ximian, Inc.
  */
 
-#include <mono/utils/mono-publib.h>
-
-MONO_BEGIN_DECLS
-
-#define MONO_CUSTOM_PREFIX 0xf0
-
-#define OPDEF(a,b,c,d,e,f,g,h,i,j) \
-	MONO_ ## a,
-
-typedef enum MonoOpcodeEnum {
-	MonoOpcodeEnum_Invalid = -1,
-#include "mono/cil/opcode.def"
-	MONO_CEE_LAST
-} MonoOpcodeEnum;
-
-#undef OPDEF
-
-enum {
-	MONO_FLOW_NEXT,
-	MONO_FLOW_BRANCH,
-	MONO_FLOW_COND_BRANCH,
-	MONO_FLOW_ERROR,
-	MONO_FLOW_CALL,
-	MONO_FLOW_RETURN,
-	MONO_FLOW_META
-};
-
-enum {
-	MonoInlineNone          = 0,
-	MonoInlineType          = 1,
-	MonoInlineField         = 2,
-	MonoInlineMethod        = 3,
-	MonoInlineTok           = 4,
-	MonoInlineString        = 5,
-	MonoInlineSig           = 6,
-	MonoInlineVar           = 7,
-	MonoShortInlineVar      = 8,
-	MonoInlineBrTarget      = 9,
-	MonoShortInlineBrTarget = 10,
-	MonoInlineSwitch        = 11,
-	MonoInlineR             = 12,
-	MonoShortInlineR        = 13,
-	MonoInlineI             = 14,
-	MonoShortInlineI        = 15,
-	MonoInlineI8            = 16,
-};
-
-typedef struct {
-	unsigned char argument;
-	unsigned char flow_type;
-	unsigned short opval;
-} MonoOpcode;
+#include <mono/metadata/details/opcodes-types.h>
 
 MONO_BEGIN_DECLS
 MONO_API_DATA const MonoOpcode mono_opcodes [];
-MONO_END_DECLS
-
-MONO_API const char*
-mono_opcode_name (int opcode);
-
-MONO_API MonoOpcodeEnum
-mono_opcode_value (const mono_byte **ip, const mono_byte *end);
 
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/opcodes-functions.h>
+#undef MONO_API_FUNCTION
 MONO_END_DECLS
 
 #endif /* __MONO_METADATA_OPCODES_H__ */
diff --git a/src/native/public/mono/metadata/profiler.h b/src/native/public/mono/metadata/profiler.h
index 2fd2d840f82a53..9a66aa952e47eb 100644
--- a/src/native/public/mono/metadata/profiler.h
+++ b/src/native/public/mono/metadata/profiler.h
@@ -6,9 +6,7 @@
 #ifndef __MONO_PROFILER_H__
 #define __MONO_PROFILER_H__
 
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/mono-gc.h>
-#include <mono/metadata/object.h>
+#include <mono/metadata/details/profiler-types.h>
 
 MONO_BEGIN_DECLS
 
@@ -32,143 +30,9 @@ MONO_BEGIN_DECLS
  */
 #define MONO_PROFILER_API_VERSION 3
 
-typedef struct _MonoProfiler MonoProfiler;
-typedef struct _MonoProfilerDesc *MonoProfilerHandle;
-
-typedef void (*MonoProfilerCleanupCallback) (MonoProfiler *prof);
-
-MONO_API void mono_profiler_load (const char *desc);
-MONO_API MonoProfilerHandle mono_profiler_create (MonoProfiler *prof);
-MONO_API void mono_profiler_set_cleanup_callback (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb);
-
-typedef struct {
-	MonoMethod *method;
-	uint32_t il_offset;
-	uint32_t counter;
-	const char *file_name;
-	uint32_t line;
-	uint32_t column;
-} MonoProfilerCoverageData;
-
-typedef mono_bool (*MonoProfilerCoverageFilterCallback) (MonoProfiler *prof, MonoMethod *method);
-typedef void (*MonoProfilerCoverageCallback) (MonoProfiler *prof, const MonoProfilerCoverageData *data);
-
-MONO_API mono_bool mono_profiler_enable_coverage (void);
-MONO_API void mono_profiler_set_coverage_filter_callback (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb);
-MONO_API mono_bool mono_profiler_get_coverage_data (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb);
-
-typedef enum {
-	/**
-	 * Do not perform sampling. Will make the sampling thread sleep until the
-	 * sampling mode is changed to one of the below modes.
-	 */
-	MONO_PROFILER_SAMPLE_MODE_NONE = 0,
-	/**
-	 * Try to base sampling frequency on process activity. Falls back to
-	 * MONO_PROFILER_SAMPLE_MODE_REAL if such a clock is not available.
-	 */
-	MONO_PROFILER_SAMPLE_MODE_PROCESS = 1,
-	/**
-	 * Base sampling frequency on wall clock time. Uses a monotonic clock when
-	 * available (all major platforms).
-	 */
-	MONO_PROFILER_SAMPLE_MODE_REAL = 2,
-} MonoProfilerSampleMode;
-
-MONO_API mono_bool mono_profiler_enable_sampling (MonoProfilerHandle handle);
-MONO_API mono_bool mono_profiler_set_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq);
-MONO_API mono_bool mono_profiler_get_sample_mode (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq);
-
-MONO_API mono_bool mono_profiler_enable_allocations (void);
-MONO_API mono_bool mono_profiler_enable_clauses (void);
-
-typedef struct _MonoProfilerCallContext MonoProfilerCallContext;
-
-typedef enum {
-	/**
-	 * Do not instrument calls.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_NONE = 0,
-	/**
-	 * Instrument method entries.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_ENTER = 1 << 1,
-	/**
-	 * Also capture a call context for method entries.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_ENTER_CONTEXT = 1 << 2,
-	/**
-	 * Instrument method exits.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE = 1 << 3,
-	/**
-	 * Also capture a call context for method exits.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_LEAVE_CONTEXT = 1 << 4,
-	/**
-	 * Instrument method exits as a result of a tail call.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_TAIL_CALL = 1 << 5,
-	/**
-	 * Instrument exceptional method exits.
-	 */
-	MONO_PROFILER_CALL_INSTRUMENTATION_EXCEPTION_LEAVE = 1 << 6,
-} MonoProfilerCallInstrumentationFlags;
-
-typedef MonoProfilerCallInstrumentationFlags (*MonoProfilerCallInstrumentationFilterCallback) (MonoProfiler *prof, MonoMethod *method);
-
-MONO_API void mono_profiler_set_call_instrumentation_filter_callback (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb);
-MONO_API mono_bool mono_profiler_enable_call_context_introspection (void);
-MONO_API void *mono_profiler_call_context_get_this (MonoProfilerCallContext *context);
-MONO_API void *mono_profiler_call_context_get_argument (MonoProfilerCallContext *context, uint32_t position);
-MONO_API void *mono_profiler_call_context_get_local (MonoProfilerCallContext *context, uint32_t position);
-MONO_API void *mono_profiler_call_context_get_result (MonoProfilerCallContext *context);
-MONO_API void mono_profiler_call_context_free_buffer (void *buffer);
-
-typedef enum {
-	/**
-	 * The \c data parameter is a \c MonoMethod pointer.
-	 */
-	MONO_PROFILER_CODE_BUFFER_METHOD = 0,
-	/**
-	 * \deprecated No longer used.
-	 */
-	MONO_PROFILER_CODE_BUFFER_METHOD_TRAMPOLINE = 1,
-	/**
-	 * The \c data parameter is a \c MonoMethod pointer.
-	 */
-	MONO_PROFILER_CODE_BUFFER_UNBOX_TRAMPOLINE = 2,
-	MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE = 3,
-	MONO_PROFILER_CODE_BUFFER_GENERICS_TRAMPOLINE = 4,
-	/**
-	 * The \c data parameter is a C string.
-	 */
-	MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE = 5,
-	MONO_PROFILER_CODE_BUFFER_HELPER = 6,
-	/**
-	 * \deprecated No longer used.
-	 */
-	MONO_PROFILER_CODE_BUFFER_MONITOR = 7,
-	MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE = 8,
-	MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING = 9,
-} MonoProfilerCodeBufferType;
-
-typedef enum {
-	MONO_GC_EVENT_PRE_STOP_WORLD = 6,
-	/**
-	 * When this event arrives, the GC and suspend locks are acquired.
-	 */
-	MONO_GC_EVENT_PRE_STOP_WORLD_LOCKED = 10,
-	MONO_GC_EVENT_POST_STOP_WORLD = 7,
-	MONO_GC_EVENT_START = 0,
-	MONO_GC_EVENT_END = 5,
-	MONO_GC_EVENT_PRE_START_WORLD = 8,
-	/**
-	 * When this event arrives, the GC and suspend locks are released.
-	 */
-	MONO_GC_EVENT_POST_START_WORLD_UNLOCKED = 11,
-	MONO_GC_EVENT_POST_START_WORLD = 9,
-} MonoProfilerGCEvent;
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/profiler-functions.h>
+#undef MONO_API_FUNCTION
 
 /*
  * The macros below will generate the majority of the callback API. Refer to
diff --git a/src/native/public/mono/metadata/reflection.h b/src/native/public/mono/metadata/reflection.h
index bab5586a8d7f57..b61037a676dca2 100644
--- a/src/native/public/mono/metadata/reflection.h
+++ b/src/native/public/mono/metadata/reflection.h
@@ -5,169 +5,13 @@
 #ifndef __METADATA_REFLECTION_H__
 #define __METADATA_REFLECTION_H__
 
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/object.h>
+#include <mono/metadata/details/reflection-types.h>
 
 MONO_BEGIN_DECLS
 
-typedef struct MonoTypeNameParse MonoTypeNameParse;
-
-typedef struct {
-	MonoMethod *ctor;
-	uint32_t     data_size;
-	const mono_byte* data;
-} MonoCustomAttrEntry;
-
-typedef struct {
-	int num_attrs;
-	int cached;
-	MonoImage *image;
-	MonoCustomAttrEntry attrs [MONO_ZERO_LEN_ARRAY];
-} MonoCustomAttrInfo;
-
-#define MONO_SIZEOF_CUSTOM_ATTR_INFO (offsetof (MonoCustomAttrInfo, attrs))
-
-/*
- * Information which isn't in the MonoMethod structure is stored here for
- * dynamic methods.
- */
-typedef struct {
-	char **param_names;
-	MonoMarshalSpec **param_marshall;
-	MonoCustomAttrInfo **param_cattr;
-	uint8_t** param_defaults;
-	uint32_t *param_default_types;
-	char *dllentry, *dll;
-} MonoReflectionMethodAux;
-
-typedef enum {
-	ResolveTokenError_OutOfRange,
-	ResolveTokenError_BadTable,
-	ResolveTokenError_Other
-} MonoResolveTokenError;
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-int           mono_reflection_parse_type (char *name, MonoTypeNameParse *info);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType*     mono_reflection_get_type   (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve);
-MONO_API void          mono_reflection_free_type_info (MonoTypeNameParse *info);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType*     mono_reflection_type_from_name (char *name, MonoImage *image);
-MONO_API MONO_RT_EXTERNAL_ONLY
-uint32_t      mono_reflection_get_token (MonoObject *obj);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionAssembly* mono_assembly_get_object (MonoDomain *domain, MonoAssembly *assembly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionModule*   mono_module_get_object   (MonoDomain *domain, MonoImage *image);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionModule*   mono_module_file_get_object (MonoDomain *domain, MonoImage *image, int table_index);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionType*     mono_type_get_object     (MonoDomain *domain, MonoType *type);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionMethod*   mono_method_get_object   (MonoDomain *domain, MonoMethod *method, MonoClass *refclass);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionField*    mono_field_get_object    (MonoDomain *domain, MonoClass *klass, MonoClassField *field);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionProperty* mono_property_get_object (MonoDomain *domain, MonoClass *klass, MonoProperty *property);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionEvent*    mono_event_get_object    (MonoDomain *domain, MonoClass *klass, MonoEvent *event);
-/* note: this one is slightly different: we keep the whole array of params in the cache */
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray* mono_param_get_objects  (MonoDomain *domain, MonoMethod *method);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoReflectionMethodBody* mono_method_body_get_object (MonoDomain *domain, MonoMethod *method);
-
-MONO_API MonoObject *mono_get_dbnull_object (MonoDomain *domain);
-
-MONO_API MonoArray*  mono_reflection_get_custom_attrs_by_type (MonoObject *obj, MonoClass *attr_klass, MonoError *error);
-MONO_API MonoArray*  mono_reflection_get_custom_attrs (MonoObject *obj);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*  mono_reflection_get_custom_attrs_data (MonoObject *obj);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*  mono_reflection_get_custom_attrs_blob (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_reflection_get_custom_attrs_info (MonoObject *obj);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoArray*  mono_custom_attrs_construct (MonoCustomAttrInfo *cinfo);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_index    (MonoImage *image, uint32_t idx);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_method   (MonoMethod *method);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_class    (MonoClass *klass);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_assembly (MonoAssembly *assembly);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_property (MonoClass *klass, MonoProperty *property);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_event    (MonoClass *klass, MonoEvent *event);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_field    (MonoClass *klass, MonoClassField *field);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoCustomAttrInfo* mono_custom_attrs_from_param    (MonoMethod *method, uint32_t param);
-MONO_API mono_bool           mono_custom_attrs_has_attr      (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass);
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoObject*         mono_custom_attrs_get_attr      (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass);
-MONO_API void                mono_custom_attrs_free          (MonoCustomAttrInfo *ainfo);
-
-
-#define MONO_DECLSEC_ACTION_MIN		0x1
-#define MONO_DECLSEC_ACTION_MAX		0x12
-
-enum {
-	MONO_DECLSEC_FLAG_REQUEST 			= 0x00000001,
-	MONO_DECLSEC_FLAG_DEMAND			= 0x00000002,
-	MONO_DECLSEC_FLAG_ASSERT			= 0x00000004,
-	MONO_DECLSEC_FLAG_DENY				= 0x00000008,
-	MONO_DECLSEC_FLAG_PERMITONLY			= 0x00000010,
-	MONO_DECLSEC_FLAG_LINKDEMAND			= 0x00000020,
-	MONO_DECLSEC_FLAG_INHERITANCEDEMAND		= 0x00000040,
-	MONO_DECLSEC_FLAG_REQUEST_MINIMUM		= 0x00000080,
-	MONO_DECLSEC_FLAG_REQUEST_OPTIONAL		= 0x00000100,
-	MONO_DECLSEC_FLAG_REQUEST_REFUSE		= 0x00000200,
-	MONO_DECLSEC_FLAG_PREJIT_GRANT			= 0x00000400,
-	MONO_DECLSEC_FLAG_PREJIT_DENY			= 0x00000800,
-	MONO_DECLSEC_FLAG_NONCAS_DEMAND			= 0x00001000,
-	MONO_DECLSEC_FLAG_NONCAS_LINKDEMAND		= 0x00002000,
-	MONO_DECLSEC_FLAG_NONCAS_INHERITANCEDEMAND	= 0x00004000,
-	MONO_DECLSEC_FLAG_LINKDEMAND_CHOICE		= 0x00008000,
-	MONO_DECLSEC_FLAG_INHERITANCEDEMAND_CHOICE	= 0x00010000,
-	MONO_DECLSEC_FLAG_DEMAND_CHOICE			= 0x00020000
-};
-
-MONO_API uint32_t mono_declsec_flags_from_method (MonoMethod *method);
-MONO_API uint32_t mono_declsec_flags_from_class (MonoClass *klass);
-MONO_API uint32_t mono_declsec_flags_from_assembly (MonoAssembly *assembly);
-
-/* this structure MUST be kept in synch with RuntimeDeclSecurityEntry
- * located in /mcs/class/corlib/System.Security/SecurityFrame.cs */
-typedef struct {
-	char *blob;				/* pointer to metadata blob */
-	uint32_t size;				/* size of the metadata blob */
-	uint32_t index;
-} MonoDeclSecurityEntry;
-
-typedef struct {
-	MonoDeclSecurityEntry demand;
-	MonoDeclSecurityEntry noncasdemand;
-	MonoDeclSecurityEntry demandchoice;
-} MonoDeclSecurityActions;
-
-MONO_API MonoBoolean mono_declsec_get_demands (MonoMethod *callee, MonoDeclSecurityActions* demands);
-MONO_API MonoBoolean mono_declsec_get_linkdemands (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* cmethod);
-MONO_API MonoBoolean mono_declsec_get_inheritdemands_class (MonoClass *klass, MonoDeclSecurityActions* demands);
-MONO_API MonoBoolean mono_declsec_get_inheritdemands_method (MonoMethod *callee, MonoDeclSecurityActions* demands);
-
-MONO_API MonoBoolean mono_declsec_get_method_action (MonoMethod *method, uint32_t action, MonoDeclSecurityEntry *entry);
-MONO_API MonoBoolean mono_declsec_get_class_action (MonoClass *klass, uint32_t action, MonoDeclSecurityEntry *entry);
-MONO_API MonoBoolean mono_declsec_get_assembly_action (MonoAssembly *assembly, uint32_t action, MonoDeclSecurityEntry *entry);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoType* mono_reflection_type_get_type (MonoReflectionType *reftype);
-
-MONO_API MonoAssembly* mono_reflection_assembly_get_assembly (MonoReflectionAssembly *refassembly);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/reflection-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/sgen-bridge.h b/src/native/public/mono/metadata/sgen-bridge.h
index 0b91359064d97e..453c7285bb6b6b 100644
--- a/src/native/public/mono/metadata/sgen-bridge.h
+++ b/src/native/public/mono/metadata/sgen-bridge.h
@@ -52,58 +52,13 @@
 
 #include <mono/utils/mono-publib.h>
 
-MONO_BEGIN_DECLS
-
-enum {
-	SGEN_BRIDGE_VERSION = 5
-};
-
-typedef enum {
-	/* Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List<object>*/
-	GC_BRIDGE_TRANSPARENT_CLASS,
-	/* Instances of this class should not be scanned when computing the transitive dependency among bridges. E.g. String*/
-	GC_BRIDGE_OPAQUE_CLASS,
-	/* Instances of this class should be bridged and have their dependency computed. */
-	GC_BRIDGE_TRANSPARENT_BRIDGE_CLASS,
-	/* Instances of this class should be bridged but no dependencies should not be calculated. */
-	GC_BRIDGE_OPAQUE_BRIDGE_CLASS,
-} MonoGCBridgeObjectKind;
-
-typedef struct {
-	mono_bool is_alive;	/* to be set by the cross reference callback */
-	int num_objs;
-	MonoObject *objs [MONO_ZERO_LEN_ARRAY];
-} MonoGCBridgeSCC;
-
-typedef struct {
-	int src_scc_index;
-	int dst_scc_index;
-} MonoGCBridgeXRef;
+#include <mono/metadata/details/sgen-bridge-types.h>
 
-typedef struct {
-	int bridge_version;
-	/*
-	 * Tells the runtime which classes to even consider when looking for
-	 * bridged objects.  If subclasses are to be considered as well, the
-	 * subclass check must be done in the callback.
-	 */
-	MonoGCBridgeObjectKind (*bridge_class_kind) (MonoClass *klass);
-	/*
-	 * This is only called on objects for whose classes
-	 * `bridge_class_kind()` returned `XXX_BRIDGE_CLASS`.
-	 */
-	mono_bool (*is_bridge_object) (MonoObject *object);
-	void (*cross_references) (int num_sccs, MonoGCBridgeSCC **sccs, int num_xrefs, MonoGCBridgeXRef *xrefs);
-} MonoGCBridgeCallbacks;
-
-/*
- * Note: This may be called at any time, but cannot be called concurrently
- * with (during and on a separate thread from) sgen init. Callers are
- * responsible for enforcing this.
- */
-MONO_API void mono_gc_register_bridge_callbacks (MonoGCBridgeCallbacks *callbacks);
+MONO_BEGIN_DECLS
 
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_gc_wait_for_bridge_processing (void);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/sgen-bridge-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/mono/metadata/threads.h b/src/native/public/mono/metadata/threads.h
index 146d6d50493ad3..8a9e2185851baa 100644
--- a/src/native/public/mono/metadata/threads.h
+++ b/src/native/public/mono/metadata/threads.h
@@ -12,58 +12,13 @@
 #ifndef _MONO_METADATA_THREADS_H_
 #define _MONO_METADATA_THREADS_H_
 
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/appdomain.h>
+#include <mono/metadata/details/threads-types.h>
 
 MONO_BEGIN_DECLS
 
-/* This callback should return TRUE if the runtime must wait for the thread, FALSE otherwise */
-typedef mono_bool (*MonoThreadManageCallback) (MonoThread* thread);
-
-MONO_API void mono_thread_init (MonoThreadStartCB start_cb,
-			      MonoThreadAttachCB attach_cb);
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_thread_cleanup (void);
-MONO_API MONO_RT_EXTERNAL_ONLY
-void mono_thread_manage(void);
-
-MONO_API MonoThread *mono_thread_current (void);
-
-MONO_API void        mono_thread_set_main (MonoThread *thread);
-MONO_API MonoThread *mono_thread_get_main (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void mono_thread_stop (MonoThread *thread);
-
-MONO_API void mono_thread_new_init (intptr_t tid, void* stack_start,
-				  void* func);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_thread_create (MonoDomain *domain, void* func, void* arg);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoThread *
-mono_thread_attach (MonoDomain *domain);
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_thread_detach (MonoThread *thread);
-MONO_API void mono_thread_exit (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_threads_attach_tools_thread (void);
-
-MONO_API char   *mono_thread_get_name_utf8 (MonoThread *thread);
-MONO_API int32_t mono_thread_get_managed_id (MonoThread *thread);
-
-MONO_API void     mono_thread_set_manage_callback (MonoThread *thread, MonoThreadManageCallback func);
-
-MONO_API void mono_threads_set_default_stacksize (uint32_t stacksize);
-MONO_API uint32_t mono_threads_get_default_stacksize (void);
-
-MONO_API void mono_threads_request_thread_dump (void);
-
-MONO_API mono_bool mono_thread_is_foreign (MonoThread *thread);
-
-MONO_API MONO_RT_EXTERNAL_ONLY mono_bool
-mono_thread_detach_if_exiting (void);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/metadata/details/threads-functions.h>
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake
index 555eb7371a5c38..19fb2a646e02be 100644
--- a/src/native/public/monoapi.cmake
+++ b/src/native/public/monoapi.cmake
@@ -58,7 +58,45 @@ set(metadata_public_headers_base
 	sgen-bridge.h
 	threads.h
 	tokentype.h
-	verify.h)
+	verify.h
+	details/environment-functions.h
+	details/opcodes-types.h
+	details/opcodes-functions.h
+	details/sgen-bridge-types.h
+	details/sgen-bridge-functions.h
+	details/image-types.h
+	details/image-functions.h
+	details/metadata-types.h
+	details/metadata-functions.h
+	details/assembly-types.h
+	details/assembly-functions.h
+	details/loader-types.h
+	details/loader-functions.h
+	details/class-types.h
+	details/class-functions.h
+	details/object-types.h
+	details/object-functions.h
+	details/exception-types.h
+	details/exception-functions.h
+	details/reflection-types.h
+	details/reflection-functions.h
+	details/appdomain-types.h
+	details/appdomain-functions.h
+	details/threads-types.h
+	details/threads-functions.h
+	details/debug-helpers-types.h
+	details/debug-helpers-functions.h
+	details/mono-debug-types.h
+	details/mono-debug-functions.h
+	details/mono-gc-types.h
+	details/mono-gc-functions.h
+	details/mono-config-types.h
+	details/mono-config-functions.h
+	details/profiler-types.h
+	details/profiler-functions.h
+	details/mono-private-unstable-types.h
+	details/mono-private-unstable-functions.h
+	)
 addprefix(metadata_public_headers ./mono/metadata/ "${metadata_public_headers_base}")
 
 set_target_properties(monoapi_metadata PROPERTIES PUBLIC_HEADER "${metadata_public_headers}")

From 8bf2cabfad56edda571414f5819bc61f17fa0d69 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Fri, 18 Feb 2022 12:37:11 -0500
Subject: [PATCH 04/14] Split mini jit headers

One complication here is that the directory is called "jit" outside the
runtime, but "mini", inside.
---
 .../public/mono/mini/details/jit-functions.h  |  47 +++++++
 .../public/mono/mini/details/jit-types.h      |  61 ++++++++++
 src/native/public/mono/mini/jit.h             | 115 ++----------------
 src/native/public/monoapi.cmake               |   5 +-
 4 files changed, 124 insertions(+), 104 deletions(-)
 create mode 100644 src/native/public/mono/mini/details/jit-functions.h
 create mode 100644 src/native/public/mono/mini/details/jit-types.h

diff --git a/src/native/public/mono/mini/details/jit-functions.h b/src/native/public/mono/mini/details/jit-functions.h
new file mode 100644
index 00000000000000..00076685107c99
--- /dev/null
+++ b/src/native/public/mono/mini/details/jit-functions.h
@@ -0,0 +1,47 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init, (const char *file))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init_version, (const char *root_domain_name, const char *runtime_version))
+
+MONO_API_FUNCTION(MONO_API MonoDomain *, mono_jit_init_version_for_test_only, (const char *root_domain_name, const char *runtime_version))
+
+MONO_API_FUNCTION(MONO_API int, mono_jit_exec, (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]))
+MONO_API_FUNCTION(MONO_API void, mono_jit_cleanup, (MonoDomain *domain))
+
+MONO_API_FUNCTION(MONO_API mono_bool, mono_jit_set_trace_options, (const char* options))
+
+MONO_API_FUNCTION(MONO_API void, mono_set_signal_chaining, (mono_bool chain_signals))
+
+MONO_API_FUNCTION(MONO_API void, mono_set_crash_chaining, (mono_bool chain_signals))
+
+/**
+ * This function is deprecated, use mono_jit_set_aot_mode instead.
+ */
+MONO_API_FUNCTION(MONO_API void, mono_jit_set_aot_only, (mono_bool aot_only))
+
+MONO_API_FUNCTION(MONO_API void, mono_jit_set_aot_mode, (MonoAotMode mode))
+
+/*
+ * Returns whether the runtime was invoked for the purpose of AOT-compiling an
+ * assembly, i.e. no managed code will run.
+ */
+MONO_API_FUNCTION(MONO_API mono_bool, mono_jit_aot_compiling, (void))
+
+MONO_API_FUNCTION(MONO_API void, mono_set_break_policy, (MonoBreakPolicyFunc policy_callback))
+
+MONO_API_FUNCTION(MONO_API void, mono_jit_parse_options, (int argc, char * argv[]))
+
+MONO_API_FUNCTION(MONO_API char*, mono_get_runtime_build_info, (void))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_set_use_llvm, (mono_bool use_llvm))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_aot_register_module, (void **aot_info))
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_jit_thread_attach, (MonoDomain *domain))
diff --git a/src/native/public/mono/mini/details/jit-types.h b/src/native/public/mono/mini/details/jit-types.h
new file mode 100644
index 00000000000000..8d1c2961496187
--- /dev/null
+++ b/src/native/public/mono/mini/details/jit-types.h
@@ -0,0 +1,61 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_JIT_TYPES_H
+#define _MONO_JIT_TYPES_H
+
+#include <mono/metadata/details/appdomain-types.h>
+
+MONO_BEGIN_DECLS
+
+/**
+ * Allows control over our AOT (Ahead-of-time) compilation mode.
+ */
+typedef enum {
+	/* Disables AOT mode */
+	MONO_AOT_MODE_NONE,
+	/* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */
+	MONO_AOT_MODE_NORMAL,
+	/* Enables hybrid AOT mode, JIT can still be used for wrappers */
+	MONO_AOT_MODE_HYBRID,
+	/* Enables full AOT mode, JIT is disabled and not allowed,
+	 * equivalent to mono_jit_set_aot_only (true) */
+	MONO_AOT_MODE_FULL,
+	/* Same as full, but use only llvm compiled code */
+	MONO_AOT_MODE_LLVMONLY,
+	/*
+	 * Use interpreter only, no native code is generated
+	 * at runtime. Trampolines are loaded from corlib aot image.
+	 */
+	MONO_AOT_MODE_INTERP,
+	/* Same as INTERP, but use only llvm compiled code */
+	MONO_AOT_MODE_INTERP_LLVMONLY,
+	/* Use only llvm compiled code, fall back to the interpeter */
+	MONO_AOT_MODE_LLVMONLY_INTERP,
+	/* Same as --interp */
+	MONO_AOT_MODE_INTERP_ONLY,
+	/* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */
+	MONO_AOT_MODE_LAST = 1000,
+} MonoAotMode;
+
+/* Allow embedders to decide wherther to actually obey breakpoint instructions
+ * in specific methods (works for both break IL instructions and Debugger.Break ()
+ * method calls).
+ */
+typedef enum {
+	/* the default is to always obey the breakpoint */
+	MONO_BREAK_POLICY_ALWAYS,
+	/* a nop is inserted instead of a breakpoint */
+	MONO_BREAK_POLICY_NEVER,
+	/* the breakpoint is executed only if the program has ben started under
+	 * the debugger (that is if a debugger was attached at the time the method
+	 * was compiled).
+	 */
+	MONO_BREAK_POLICY_ON_DBG
+} MonoBreakPolicy;
+
+typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method);
+
+MONO_END_DECLS
+
+#endif /* _MONO_JIT_TYPES_H */
diff --git a/src/native/public/mono/mini/jit.h b/src/native/public/mono/mini/jit.h
index c3413106b1ccd3..0b1525c1b419bb 100644
--- a/src/native/public/mono/mini/jit.h
+++ b/src/native/public/mono/mini/jit.h
@@ -9,112 +9,21 @@
 #ifndef _MONO_JIT_JIT_H_
 #define _MONO_JIT_JIT_H_
 
-#include <mono/metadata/appdomain.h>
+#if defined(MONO_INSIDE_RUNTIME)
+#include <mono/mini/details/jit-types.h>
+#else
+#include <mono/jit/details/jit-types.h>
+#endif
 
 MONO_BEGIN_DECLS
 
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
-mono_jit_init              (const char *file);
-
-MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *
-mono_jit_init_version      (const char *root_domain_name, const char *runtime_version);
-
-MONO_API MonoDomain *
-mono_jit_init_version_for_test_only      (const char *root_domain_name, const char *runtime_version);
-
-MONO_API int
-mono_jit_exec              (MonoDomain *domain, MonoAssembly *assembly,
-			    int argc, char *argv[]);
-MONO_API void
-mono_jit_cleanup           (MonoDomain *domain);
-
-MONO_API mono_bool
-mono_jit_set_trace_options (const char* options);
-
-MONO_API void
-mono_set_signal_chaining   (mono_bool chain_signals);
-
-MONO_API void
-mono_set_crash_chaining   (mono_bool chain_signals);
-
-/**
- * This function is deprecated, use mono_jit_set_aot_mode instead.
- */
-MONO_API void
-mono_jit_set_aot_only      (mono_bool aot_only);
-
-/**
- * Allows control over our AOT (Ahead-of-time) compilation mode.
- */
-typedef enum {
-	/* Disables AOT mode */
-	MONO_AOT_MODE_NONE,
-	/* Enables normal AOT mode, equivalent to mono_jit_set_aot_only (false) */
-	MONO_AOT_MODE_NORMAL,
-	/* Enables hybrid AOT mode, JIT can still be used for wrappers */
-	MONO_AOT_MODE_HYBRID,
-	/* Enables full AOT mode, JIT is disabled and not allowed,
-	 * equivalent to mono_jit_set_aot_only (true) */
-	MONO_AOT_MODE_FULL,
-	/* Same as full, but use only llvm compiled code */
-	MONO_AOT_MODE_LLVMONLY,
-	/*
-	 * Use interpreter only, no native code is generated
-	 * at runtime. Trampolines are loaded from corlib aot image.
-	 */
-	MONO_AOT_MODE_INTERP,
-	/* Same as INTERP, but use only llvm compiled code */
-	MONO_AOT_MODE_INTERP_LLVMONLY,
-	/* Use only llvm compiled code, fall back to the interpeter */
-	MONO_AOT_MODE_LLVMONLY_INTERP,
-	/* Same as --interp */
-	MONO_AOT_MODE_INTERP_ONLY,
-	/* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */
-	MONO_AOT_MODE_LAST = 1000,
-} MonoAotMode;
-
-MONO_API void
-mono_jit_set_aot_mode      (MonoAotMode mode);
-
-/*
- * Returns whether the runtime was invoked for the purpose of AOT-compiling an
- * assembly, i.e. no managed code will run.
- */
-MONO_API mono_bool
-mono_jit_aot_compiling (void);
-
-/* Allow embedders to decide wherther to actually obey breakpoint instructions
- * in specific methods (works for both break IL instructions and Debugger.Break ()
- * method calls).
- */
-typedef enum {
-	/* the default is to always obey the breakpoint */
-	MONO_BREAK_POLICY_ALWAYS,
-	/* a nop is inserted instead of a breakpoint */
-	MONO_BREAK_POLICY_NEVER,
-	/* the breakpoint is executed only if the program has ben started under
-	 * the debugger (that is if a debugger was attached at the time the method
-	 * was compiled).
-	 */
-	MONO_BREAK_POLICY_ON_DBG
-} MonoBreakPolicy;
-
-typedef MonoBreakPolicy (*MonoBreakPolicyFunc) (MonoMethod *method);
-MONO_API void mono_set_break_policy (MonoBreakPolicyFunc policy_callback);
-
-MONO_API void
-mono_jit_parse_options     (int argc, char * argv[]);
-
-MONO_API char*       mono_get_runtime_build_info    (void);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_set_use_llvm (mono_bool use_llvm);
-
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_aot_register_module (void **aot_info);
-
-MONO_API MONO_RT_EXTERNAL_ONLY
-MonoDomain* mono_jit_thread_attach (MonoDomain *domain);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#if defined(MONO_INSIDE_RUNTIME)
+#include <mono/mini/details/jit-functions.h>
+#else
+#include <mono/jit/details/jit-functions.h>
+#endif
+#undef MONO_API_FUNCTION
 
 MONO_END_DECLS
 
diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake
index 19fb2a646e02be..a374025800df2c 100644
--- a/src/native/public/monoapi.cmake
+++ b/src/native/public/monoapi.cmake
@@ -105,7 +105,10 @@ add_library(monoapi_mini INTERFACE)
 
 set(mini_public_headers_base
   jit.h
-  mono-private-unstable.h)
+  mono-private-unstable.h
+  details/jit-types.h
+  details/jit-functions.h
+  )
 addprefix(mini_public_headers ./mono/mini "${mini_public_headers_base}")
 
 set_target_properties(monoapi_mini PROPERTIES PUBLIC_HEADER "${mini_public_headers}")

From 2e4484cc352154eba8bcf62e36126ff70beb311d Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Fri, 18 Feb 2022 12:54:56 -0500
Subject: [PATCH 05/14] rename public mono/mini subdirectory to mono/jit

To match how embedders see the tree.

Update the runtime to include <mono/jit/jit.h> instead of <mono/mini/jit.h>.

No change in public API
---
 src/mono/mono/eventpipe/test/ep-setup-tests.c        |  2 +-
 src/mono/mono/eventpipe/test/ep-teardown-tests.c     |  2 +-
 src/mono/mono/metadata/domain-internals.h            |  2 +-
 src/mono/mono/metadata/jit-info.h                    |  2 +-
 src/mono/mono/mini/aot-runtime-wasm.c                |  2 +-
 src/mono/mono/mini/aot-runtime.c                     |  2 +-
 src/mono/mono/mini/debug-mini.c                      |  2 +-
 src/mono/mono/mini/driver.c                          |  2 +-
 src/mono/mono/mini/method-to-ir.c                    |  2 +-
 src/mono/mono/mini/mini.h                            |  2 +-
 src/mono/mono/mini/monovm.h                          |  2 +-
 src/mono/mono/profiler/aot.c                         |  2 +-
 src/mono/mono/profiler/coverage.c                    |  2 +-
 src/mono/mono/profiler/log.c                         |  2 +-
 src/mono/mono/unit-tests/test-embed-invoke.c         |  2 +-
 src/mono/mono/unit-tests/test-mono-callspec.c        |  2 +-
 src/mono/mono/unit-tests/test-mono-embed.c           |  2 +-
 src/mono/mono/unit-tests/test-mono-string.c          |  2 +-
 src/mono/wasi/mono-wasi-driver/driver.c              |  4 ++--
 .../mono/{mini => jit}/details/jit-functions.h       |  0
 .../public/mono/{mini => jit}/details/jit-types.h    |  0
 src/native/public/mono/{mini => jit}/jit.h           |  8 --------
 .../mono/{mini => jit}/mono-private-unstable.h       |  0
 src/native/public/monoapi.cmake                      | 12 ++++++------
 24 files changed, 26 insertions(+), 34 deletions(-)
 rename src/native/public/mono/{mini => jit}/details/jit-functions.h (100%)
 rename src/native/public/mono/{mini => jit}/details/jit-types.h (100%)
 rename src/native/public/mono/{mini => jit}/jit.h (67%)
 rename src/native/public/mono/{mini => jit}/mono-private-unstable.h (100%)

diff --git a/src/mono/mono/eventpipe/test/ep-setup-tests.c b/src/mono/mono/eventpipe/test/ep-setup-tests.c
index 6bb24553e7f356..38376ecdb0a362 100644
--- a/src/mono/mono/eventpipe/test/ep-setup-tests.c
+++ b/src/mono/mono/eventpipe/test/ep-setup-tests.c
@@ -1,6 +1,6 @@
 #include <eventpipe/ep.h>
 #include <eglib/test/test.h>
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include <mono/metadata/assembly.h>
 
 MonoDomain *eventpipe_test_domain;
diff --git a/src/mono/mono/eventpipe/test/ep-teardown-tests.c b/src/mono/mono/eventpipe/test/ep-teardown-tests.c
index 2d663a528bc186..3f1d75572ce6ed 100644
--- a/src/mono/mono/eventpipe/test/ep-teardown-tests.c
+++ b/src/mono/mono/eventpipe/test/ep-teardown-tests.c
@@ -1,6 +1,6 @@
 #include <eventpipe/ep.h>
 #include <eglib/test/test.h>
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 
 #define TEST_FILE "./ep_test_create_file.txt"
 #define TEST_FILE_2 "./ep_test_create_file_2.txt"
diff --git a/src/mono/mono/metadata/domain-internals.h b/src/mono/mono/metadata/domain-internals.h
index 65a44da3a28b44..3834cf7e96895f 100644
--- a/src/mono/mono/metadata/domain-internals.h
+++ b/src/mono/mono/metadata/domain-internals.h
@@ -20,7 +20,7 @@
 #include <mono/metadata/loader-internals.h>
 #include <mono/metadata/mempool-internals.h>
 #include <mono/metadata/handle-decl.h>
-#include <mono/mini/mono-private-unstable.h>
+#include <mono/jit/mono-private-unstable.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/mono/mono/metadata/jit-info.h b/src/mono/mono/metadata/jit-info.h
index bdf6572de173c1..be6c77d175db24 100644
--- a/src/mono/mono/metadata/jit-info.h
+++ b/src/mono/mono/metadata/jit-info.h
@@ -20,7 +20,7 @@
 #include <mono/metadata/loader-internals.h>
 #include <mono/metadata/mempool-internals.h>
 #include <mono/metadata/handle-decl.h>
-#include <mono/mini/mono-private-unstable.h>
+#include <mono/jit/mono-private-unstable.h>
 
 G_BEGIN_DECLS
 
diff --git a/src/mono/mono/mini/aot-runtime-wasm.c b/src/mono/mono/mini/aot-runtime-wasm.c
index 9de88b4def4807..bd035718814508 100644
--- a/src/mono/mono/mini/aot-runtime-wasm.c
+++ b/src/mono/mono/mini/aot-runtime-wasm.c
@@ -8,7 +8,7 @@
 #include <sys/types.h>
 
 #include "mini.h"
-#include <mono/mini/mono-private-unstable.h>
+#include <mono/jit/mono-private-unstable.h>
 #include "interp/interp.h"
 
 #ifdef TARGET_WASM
diff --git a/src/mono/mono/mini/aot-runtime.c b/src/mono/mono/mini/aot-runtime.c
index a42b2bccc2f267..375b23fbf3981c 100644
--- a/src/mono/mono/mini/aot-runtime.c
+++ b/src/mono/mono/mini/aot-runtime.c
@@ -69,7 +69,7 @@
 #include "aot-runtime.h"
 #include "jit-icalls.h"
 #include "mini-runtime.h"
-#include <mono/mini/mono-private-unstable.h>
+#include <mono/jit/mono-private-unstable.h>
 #include "llvmonly-runtime.h"
 
 #include <mono/metadata/components.h>
diff --git a/src/mono/mono/mini/debug-mini.c b/src/mono/mono/mini/debug-mini.c
index af03122472fe58..243188e36df24c 100644
--- a/src/mono/mono/mini/debug-mini.c
+++ b/src/mono/mono/mini/debug-mini.c
@@ -10,7 +10,7 @@
 
 #include "mini.h"
 #include "mini-runtime.h"
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include "config.h"
 #include <mono/metadata/verify.h>
 #include <mono/metadata/mono-config.h>
diff --git a/src/mono/mono/mini/driver.c b/src/mono/mono/mini/driver.c
index 8c9ed9dbc33aea..754496bf5532f1 100644
--- a/src/mono/mono/mini/driver.c
+++ b/src/mono/mono/mini/driver.c
@@ -58,7 +58,7 @@
 #include <mono/mini/debugger-agent-external.h>
 
 #include "mini.h"
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include "aot-compiler.h"
 #include "aot-runtime.h"
 #include "mini-runtime.h"
diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c
index 0d621ece26761a..33bc1f2292c1e5 100644
--- a/src/mono/mono/mini/method-to-ir.c
+++ b/src/mono/mono/mini/method-to-ir.c
@@ -77,7 +77,7 @@
 #include "ir-emit.h"
 
 #include "jit-icalls.h"
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include "seq-points.h"
 #include "aot-compiler.h"
 #include "mini-llvm.h"
diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h
index ade0a4c28291ee..1683ca47c6a1aa 100644
--- a/src/mono/mono/mini/mini.h
+++ b/src/mono/mono/mini/mini.h
@@ -53,7 +53,7 @@ typedef struct SeqPointInfo SeqPointInfo;
 #include "mini-arch.h"
 #include "regalloc.h"
 #include "mini-unwind.h"
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include "cfgdump.h"
 #include "tiered.h"
 
diff --git a/src/mono/mono/mini/monovm.h b/src/mono/mono/mini/monovm.h
index 990307925019fe..9ff1591f8d0c80 100644
--- a/src/mono/mono/mini/monovm.h
+++ b/src/mono/mono/mini/monovm.h
@@ -2,7 +2,7 @@
 #define _MONO_MINI_MONOVM_H_
 
 #include <mono/utils/mono-publib.h>
-#include <mono/mini/mono-private-unstable.h>
+#include <mono/jit/mono-private-unstable.h>
 
 // MonoVM equivalents of the CoreCLR hosting API and helpers
 // Only functional on netcore builds
diff --git a/src/mono/mono/profiler/aot.c b/src/mono/mono/profiler/aot.c
index 7988d23b058d0f..70d9b8ef27b1f5 100644
--- a/src/mono/mono/profiler/aot.c
+++ b/src/mono/mono/profiler/aot.c
@@ -20,7 +20,7 @@
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/utils/mono-publib.h>
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include <mono/utils/mono-logger-internals.h>
 #include <mono/utils/mono-os-mutex.h>
 #include <mono/utils/mono-threads.h>
diff --git a/src/mono/mono/profiler/coverage.c b/src/mono/mono/profiler/coverage.c
index 7afc5ab910a146..d692caf60c3b5e 100644
--- a/src/mono/mono/profiler/coverage.c
+++ b/src/mono/mono/profiler/coverage.c
@@ -68,7 +68,7 @@
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/object-internals.h>
 
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 
 #include <mono/utils/atomic.h>
 #include <mono/utils/hazard-pointer.h>
diff --git a/src/mono/mono/profiler/log.c b/src/mono/mono/profiler/log.c
index 7d9636a5130aea..2d3e7d403b58f4 100644
--- a/src/mono/mono/profiler/log.c
+++ b/src/mono/mono/profiler/log.c
@@ -30,7 +30,7 @@
 #include <mono/metadata/tabledefs.h>
 #include <mono/metadata/threads.h>
 #include <mono/metadata/threads-types.h>
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include <mono/utils/atomic.h>
 #include <mono/utils/hazard-pointer.h>
 #include <mono/utils/lock-free-alloc.h>
diff --git a/src/mono/mono/unit-tests/test-embed-invoke.c b/src/mono/mono/unit-tests/test-embed-invoke.c
index f5c14c7e70b036..b7ceadc7e54320 100644
--- a/src/mono/mono/unit-tests/test-embed-invoke.c
+++ b/src/mono/mono/unit-tests/test-embed-invoke.c
@@ -3,5 +3,5 @@
  */
 
 #define _TESTCASE_
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include <embed/test-invoke.c>
diff --git a/src/mono/mono/unit-tests/test-mono-callspec.c b/src/mono/mono/unit-tests/test-mono-callspec.c
index 147ad4f26e2d51..7821af6ed90eb0 100644
--- a/src/mono/mono/unit-tests/test-mono-callspec.c
+++ b/src/mono/mono/unit-tests/test-mono-callspec.c
@@ -26,7 +26,7 @@
 #include <mono/metadata/class-internals.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/debug-helpers.h>
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include <mono/utils/mono-error-internals.h>
 
 #define TESTPROG "callspec.exe"
diff --git a/src/mono/mono/unit-tests/test-mono-embed.c b/src/mono/mono/unit-tests/test-mono-embed.c
index cadeb302b3a0d2..d93daacc36c332 100644
--- a/src/mono/mono/unit-tests/test-mono-embed.c
+++ b/src/mono/mono/unit-tests/test-mono-embed.c
@@ -3,5 +3,5 @@
  */
 
 #define _TESTCASE_
-#include <mono/mini/jit.h>
+#include <mono/jit/jit.h>
 #include <embed/teste.c>
diff --git a/src/mono/mono/unit-tests/test-mono-string.c b/src/mono/mono/unit-tests/test-mono-string.c
index b5454861fc3bff..46317f83ea22f9 100644
--- a/src/mono/mono/unit-tests/test-mono-string.c
+++ b/src/mono/mono/unit-tests/test-mono-string.c
@@ -5,7 +5,7 @@
 #include "config.h"
 #include <stdio.h>
 #include "metadata/object-internals.h"
-#include "mini/jit.h"
+#include <mono/jit/jit.h>
 
 static int
 new_string_ok (void)
diff --git a/src/mono/wasi/mono-wasi-driver/driver.c b/src/mono/wasi/mono-wasi-driver/driver.c
index cadbcbd4aebc41..557425d030416a 100644
--- a/src/mono/wasi/mono-wasi-driver/driver.c
+++ b/src/mono/wasi/mono-wasi-driver/driver.c
@@ -21,8 +21,8 @@
 
 #include <mono/utils/mono-logger.h>
 #include <mono/utils/mono-dl-fallback.h>
-#include <mono/mini/jit.h>
-#include <mono/mini/mono-private-unstable.h>
+#include <mono/jit/jit.h>
+#include <mono/jit/mono-private-unstable.h>
 
 #include "wasm/runtime/pinvoke.h"
 
diff --git a/src/native/public/mono/mini/details/jit-functions.h b/src/native/public/mono/jit/details/jit-functions.h
similarity index 100%
rename from src/native/public/mono/mini/details/jit-functions.h
rename to src/native/public/mono/jit/details/jit-functions.h
diff --git a/src/native/public/mono/mini/details/jit-types.h b/src/native/public/mono/jit/details/jit-types.h
similarity index 100%
rename from src/native/public/mono/mini/details/jit-types.h
rename to src/native/public/mono/jit/details/jit-types.h
diff --git a/src/native/public/mono/mini/jit.h b/src/native/public/mono/jit/jit.h
similarity index 67%
rename from src/native/public/mono/mini/jit.h
rename to src/native/public/mono/jit/jit.h
index 0b1525c1b419bb..8fc0c7cbd7a0f8 100644
--- a/src/native/public/mono/mini/jit.h
+++ b/src/native/public/mono/jit/jit.h
@@ -9,20 +9,12 @@
 #ifndef _MONO_JIT_JIT_H_
 #define _MONO_JIT_JIT_H_
 
-#if defined(MONO_INSIDE_RUNTIME)
-#include <mono/mini/details/jit-types.h>
-#else
 #include <mono/jit/details/jit-types.h>
-#endif
 
 MONO_BEGIN_DECLS
 
 #define MONO_API_FUNCTION(ret,name,args) ret name args;
-#if defined(MONO_INSIDE_RUNTIME)
-#include <mono/mini/details/jit-functions.h>
-#else
 #include <mono/jit/details/jit-functions.h>
-#endif
 #undef MONO_API_FUNCTION
 
 MONO_END_DECLS
diff --git a/src/native/public/mono/mini/mono-private-unstable.h b/src/native/public/mono/jit/mono-private-unstable.h
similarity index 100%
rename from src/native/public/mono/mini/mono-private-unstable.h
rename to src/native/public/mono/jit/mono-private-unstable.h
diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake
index a374025800df2c..0b93026e8945b8 100644
--- a/src/native/public/monoapi.cmake
+++ b/src/native/public/monoapi.cmake
@@ -101,23 +101,23 @@ addprefix(metadata_public_headers ./mono/metadata/ "${metadata_public_headers_ba
 
 set_target_properties(monoapi_metadata PROPERTIES PUBLIC_HEADER "${metadata_public_headers}")
 
-add_library(monoapi_mini INTERFACE)
+add_library(monoapi_jit INTERFACE)
 
-set(mini_public_headers_base
+set(jit_public_headers_base
   jit.h
   mono-private-unstable.h
   details/jit-types.h
   details/jit-functions.h
   )
-addprefix(mini_public_headers ./mono/mini "${mini_public_headers_base}")
+addprefix(jit_public_headers ./mono/jit "${jit_public_headers_base}")
 
-set_target_properties(monoapi_mini PROPERTIES PUBLIC_HEADER "${mini_public_headers}")
+set_target_properties(monoapi_jit PROPERTIES PUBLIC_HEADER "${jit_public_headers}")
 
 add_library(monoapi INTERFACE)
-target_link_libraries(monoapi INTERFACE monoapi_utils monoapi_metadata monoapi_mini)
+target_link_libraries(monoapi INTERFACE monoapi_utils monoapi_metadata monoapi_jit)
 
 if(INSTALL_MONO_API)
   install(DIRECTORY mono/utils/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/utils)
   install(DIRECTORY mono/metadata/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/metadata)
-  install(DIRECTORY mono/mini/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit)
+  install(DIRECTORY mono/jit/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit)
 endif()

From 3af57be7f1dee88be6064523035f34d5dba38461 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Fri, 18 Feb 2022 13:01:24 -0500
Subject: [PATCH 06/14] Split remaining jit header

---
 .../details/mono-private-unstable-functions.h | 20 ++++++
 .../jit/details/mono-private-unstable-types.h | 62 +++++++++++++++++
 .../public/mono/jit/mono-private-unstable.h   | 68 ++-----------------
 src/native/public/monoapi.cmake               |  2 +
 4 files changed, 90 insertions(+), 62 deletions(-)
 create mode 100644 src/native/public/mono/jit/details/mono-private-unstable-functions.h
 create mode 100644 src/native/public/mono/jit/details/mono-private-unstable-types.h

diff --git a/src/native/public/mono/jit/details/mono-private-unstable-functions.h b/src/native/public/mono/jit/details/mono-private-unstable-functions.h
new file mode 100644
index 00000000000000..bedd7b65307c95
--- /dev/null
+++ b/src/native/public/mono/jit/details/mono-private-unstable-functions.h
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+// This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
+#ifndef MONO_API_FUNCTION
+#error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
+#endif
+
+MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_load_aot_data_hook, (MonoLoadAotDataFunc load_func, MonoFreeAotDataFunc free_func, void* user_data))
+
+MONO_API_FUNCTION(MONO_API int, monovm_initialize, (int propertyCount, const char **propertyKeys, const char **propertyValues))
+
+MONO_API_FUNCTION(MONO_API int, monovm_runtimeconfig_initialize, (MonovmRuntimeConfigArguments *arg, MonovmRuntimeConfigArgumentsCleanup cleanup_fn, void *user_data))
+
+// The wrapper MonoCoreRuntimeProperties struct can be stack-allocated or freed, but the structs inside it _must_ be heap-allocated and never freed, as they are not copied to avoid extra allocations
+MONO_API_FUNCTION(MONO_API int, monovm_initialize_preparsed, (MonoCoreRuntimeProperties *parsed_properties, int propertyCount, const char **propertyKeys, const char **propertyValues))
+
+//#ifdef HOST_WASM
+MONO_API_FUNCTION(MONO_API void, mono_wasm_install_get_native_to_interp_tramp, (MonoWasmGetNativeToInterpTramp cb))
+//#endif
diff --git a/src/native/public/mono/jit/details/mono-private-unstable-types.h b/src/native/public/mono/jit/details/mono-private-unstable-types.h
new file mode 100644
index 00000000000000..252bc01b405dbc
--- /dev/null
+++ b/src/native/public/mono/jit/details/mono-private-unstable-types.h
@@ -0,0 +1,62 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+//
+#ifndef _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H
+#define _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H
+
+#include <mono/utils/details/mono-publib-types.h>
+#include <mono/metadata/details/image-types.h>
+#include <mono/metadata/details/mono-private-unstable-types.h>
+
+MONO_BEGIN_DECLS
+
+typedef struct {
+	uint32_t kind; // 0 = Path of runtimeconfig.blob, 1 = pointer to image data, >= 2 undefined
+	union {
+		struct {
+			const char *path;
+		} name;
+		struct {
+			const char *data;
+			uint32_t data_len;
+		} data;
+	} runtimeconfig;
+} MonovmRuntimeConfigArguments;
+
+typedef void (*MonovmRuntimeConfigArgumentsCleanup)          (MonovmRuntimeConfigArguments *args, void *user_data);
+
+typedef struct {
+	uint32_t assembly_count;
+	char **basenames; /* Foo.dll */
+	uint32_t *basename_lens;
+	char **assembly_filepaths; /* /blah/blah/blah/Foo.dll */
+} MonoCoreTrustedPlatformAssemblies;
+
+typedef struct {
+	uint32_t dir_count;
+	char **dirs;
+} MonoCoreLookupPaths;
+
+typedef struct {
+	MonoCoreTrustedPlatformAssemblies *trusted_platform_assemblies;
+	MonoCoreLookupPaths *app_paths;
+	MonoCoreLookupPaths *native_dll_search_directories;
+	PInvokeOverrideFn pinvoke_override;
+} MonoCoreRuntimeProperties;
+
+/* These are used to load the AOT data for aot images compiled with MONO_AOT_FILE_FLAG_SEPARATE_DATA */
+/*
+ * Return the AOT data for ASSEMBLY. SIZE is the size of the data. OUT_HANDLE should be set to a handle which is later
+ * passed to the free function.
+ */
+typedef unsigned char* (*MonoLoadAotDataFunc)          (MonoAssembly *assembly, int size, void* user_data, void **out_handle);
+/* Not yet used */
+typedef void  (*MonoFreeAotDataFunc)          (MonoAssembly *assembly, int size, void* user_data, void *handle);
+
+//#ifdef HOST_WASM
+typedef void* (*MonoWasmGetNativeToInterpTramp) (MonoMethod *method, void *extra_arg);
+//#endif
+
+MONO_END_DECLS
+
+#endif /* _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H */
diff --git a/src/native/public/mono/jit/mono-private-unstable.h b/src/native/public/mono/jit/mono-private-unstable.h
index fade778a39857f..5a6fcb66c6dd15 100644
--- a/src/native/public/mono/jit/mono-private-unstable.h
+++ b/src/native/public/mono/jit/mono-private-unstable.h
@@ -12,70 +12,14 @@
 #ifndef __MONO_JIT_MONO_PRIVATE_UNSTABLE_H__
 #define __MONO_JIT_MONO_PRIVATE_UNSTABLE_H__
 
-#include <mono/utils/mono-publib.h>
-#include <mono/metadata/image.h>
-#include <mono/metadata/mono-private-unstable.h>
+#include <mono/jit/details/mono-private-unstable-types.h>
 
-typedef struct {
-	uint32_t kind; // 0 = Path of runtimeconfig.blob, 1 = pointer to image data, >= 2 undefined
-	union {
-		struct {
-			const char *path;
-		} name;
-		struct {
-			const char *data;
-			uint32_t data_len;
-		} data;
-	} runtimeconfig;
-} MonovmRuntimeConfigArguments;
+MONO_BEGIN_DECLS
 
-typedef void (*MonovmRuntimeConfigArgumentsCleanup)          (MonovmRuntimeConfigArguments *args, void *user_data);
+#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#include <mono/jit/details/mono-private-unstable-functions.h>
+#undef MONO_API_FUNCTION
 
-typedef struct {
-	uint32_t assembly_count;
-	char **basenames; /* Foo.dll */
-	uint32_t *basename_lens;
-	char **assembly_filepaths; /* /blah/blah/blah/Foo.dll */
-} MonoCoreTrustedPlatformAssemblies;
-
-typedef struct {
-	uint32_t dir_count;
-	char **dirs;
-} MonoCoreLookupPaths;
-
-typedef struct {
-	MonoCoreTrustedPlatformAssemblies *trusted_platform_assemblies;
-	MonoCoreLookupPaths *app_paths;
-	MonoCoreLookupPaths *native_dll_search_directories;
-	PInvokeOverrideFn pinvoke_override;
-} MonoCoreRuntimeProperties;
-
-/* These are used to load the AOT data for aot images compiled with MONO_AOT_FILE_FLAG_SEPARATE_DATA */
-/*
- * Return the AOT data for ASSEMBLY. SIZE is the size of the data. OUT_HANDLE should be set to a handle which is later
- * passed to the free function.
- */
-typedef unsigned char* (*MonoLoadAotDataFunc)          (MonoAssembly *assembly, int size, void* user_data, void **out_handle);
-/* Not yet used */
-typedef void  (*MonoFreeAotDataFunc)          (MonoAssembly *assembly, int size, void* user_data, void *handle);
-MONO_API MONO_RT_EXTERNAL_ONLY void
-mono_install_load_aot_data_hook (MonoLoadAotDataFunc load_func, MonoFreeAotDataFunc free_func, void* user_data);
-
-MONO_API int
-monovm_initialize (int propertyCount, const char **propertyKeys, const char **propertyValues);
-
-MONO_API int
-monovm_runtimeconfig_initialize (MonovmRuntimeConfigArguments *arg, MonovmRuntimeConfigArgumentsCleanup cleanup_fn, void *user_data);
-
-// The wrapper MonoCoreRuntimeProperties struct can be stack-allocated or freed, but the structs inside it _must_ be heap-allocated and never freed, as they are not copied to avoid extra allocations
-MONO_API int
-monovm_initialize_preparsed (MonoCoreRuntimeProperties *parsed_properties, int propertyCount, const char **propertyKeys, const char **propertyValues);
-
-//#ifdef HOST_WASM
-typedef void* (*MonoWasmGetNativeToInterpTramp) (MonoMethod *method, void *extra_arg);
-
-MONO_API void
-mono_wasm_install_get_native_to_interp_tramp (MonoWasmGetNativeToInterpTramp cb);
-//#endif
+MONO_END_DECLS
 
 #endif /*__MONO_JIT_MONO_PRIVATE_UNSTABLE_H__*/
diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake
index 0b93026e8945b8..e09a0028d05dcf 100644
--- a/src/native/public/monoapi.cmake
+++ b/src/native/public/monoapi.cmake
@@ -108,6 +108,8 @@ set(jit_public_headers_base
   mono-private-unstable.h
   details/jit-types.h
   details/jit-functions.h
+  details/mono-private-unstable-types.h
+  details/mono-private-unstable-functions.h
   )
 addprefix(jit_public_headers ./mono/jit "${jit_public_headers_base}")
 

From f14a0dbfd151a040178a418acdffe2f5953dbf40 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Fri, 18 Feb 2022 13:40:18 -0500
Subject: [PATCH 07/14] fix whitespace

---
 src/native/public/mono/jit/jit.h                               | 1 -
 src/native/public/mono/metadata/details/assembly-functions.h   | 3 ---
 src/native/public/mono/metadata/details/class-functions.h      | 2 --
 .../public/mono/metadata/details/environment-functions.h       | 1 -
 src/native/public/mono/metadata/details/exception-functions.h  | 1 -
 src/native/public/mono/metadata/details/loader-functions.h     | 2 --
 .../public/mono/metadata/details/mono-config-functions.h       | 2 --
 src/native/public/mono/metadata/details/mono-debug-functions.h | 1 -
 src/native/public/mono/metadata/details/mono-gc-functions.h    | 1 -
 .../mono/metadata/details/mono-private-unstable-functions.h    | 1 -
 src/native/public/mono/metadata/details/object-functions.h     | 1 -
 src/native/public/mono/metadata/details/opcodes-functions.h    | 1 -
 src/native/public/mono/metadata/details/reflection-functions.h | 2 --
 .../public/mono/metadata/details/sgen-bridge-functions.h       | 3 ---
 src/native/public/mono/metadata/details/threads-functions.h    | 1 -
 src/native/public/mono/utils/details/mono-counters-functions.h | 3 ---
 .../public/mono/utils/details/mono-dl-fallback-functions.h     | 2 --
 src/native/public/mono/utils/details/mono-error-functions.h    | 2 --
 src/native/public/mono/utils/details/mono-logger-functions.h   | 2 --
 19 files changed, 32 deletions(-)

diff --git a/src/native/public/mono/jit/jit.h b/src/native/public/mono/jit/jit.h
index 8fc0c7cbd7a0f8..1ad43823ce529a 100644
--- a/src/native/public/mono/jit/jit.h
+++ b/src/native/public/mono/jit/jit.h
@@ -20,4 +20,3 @@ MONO_BEGIN_DECLS
 MONO_END_DECLS
 
 #endif
-
diff --git a/src/native/public/mono/metadata/details/assembly-functions.h b/src/native/public/mono/metadata/details/assembly-functions.h
index 76b3c648b4cb1b..c6c14619edbfa8 100644
--- a/src/native/public/mono/metadata/details/assembly-functions.h
+++ b/src/native/public/mono/metadata/details/assembly-functions.h
@@ -73,6 +73,3 @@ MONO_API_FUNCTION(MONO_API void, mono_register_machine_config, (const char *conf
 MONO_API_FUNCTION(MONO_API void, mono_set_rootdir, (void))
 MONO_API_FUNCTION(MONO_API void, mono_set_dirs, (const char *assembly_dir, const char *config_dir))
 MONO_API_FUNCTION(MONO_API void, mono_set_assemblies_path, (const char* path))
-
-
-
diff --git a/src/native/public/mono/metadata/details/class-functions.h b/src/native/public/mono/metadata/details/class-functions.h
index 76b4b0614f2dc5..856c8d82d24fdb 100644
--- a/src/native/public/mono/metadata/details/class-functions.h
+++ b/src/native/public/mono/metadata/details/class-functions.h
@@ -181,5 +181,3 @@ MONO_API_FUNCTION(MONO_API mono_bool, mono_method_can_access_method, (MonoMethod
 MONO_API_FUNCTION(MONO_API mono_bool, mono_class_is_nullable, (MonoClass *klass))
 
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_nullable_param, (MonoClass *klass))
-
-
diff --git a/src/native/public/mono/metadata/details/environment-functions.h b/src/native/public/mono/metadata/details/environment-functions.h
index 14ad0b797243ee..b4fd7ce7c38e02 100644
--- a/src/native/public/mono/metadata/details/environment-functions.h
+++ b/src/native/public/mono/metadata/details/environment-functions.h
@@ -9,4 +9,3 @@
 MONO_API_FUNCTION(MONO_API int32_t, mono_environment_exitcode_get, (void))
 MONO_API_FUNCTION(MONO_API void, mono_environment_exitcode_set, (int32_t value))
 
-
diff --git a/src/native/public/mono/metadata/details/exception-functions.h b/src/native/public/mono/metadata/details/exception-functions.h
index d16a3ff613c75c..d78ca33e5b70f9 100644
--- a/src/native/public/mono/metadata/details/exception-functions.h
+++ b/src/native/public/mono/metadata/details/exception-functions.h
@@ -97,4 +97,3 @@ MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_excep
  * If no hook has been installed, the runtime will print a message before aborting.
  */
 MONO_API_FUNCTION(MONO_API void, mono_install_unhandled_exception_hook, (MonoUnhandledExceptionFunc func, void *user_data))
-
diff --git a/src/native/public/mono/metadata/details/loader-functions.h b/src/native/public/mono/metadata/details/loader-functions.h
index 2ef1da13c23a42..00c2896ba75a55 100644
--- a/src/native/public/mono/metadata/details/loader-functions.h
+++ b/src/native/public/mono/metadata/details/loader-functions.h
@@ -62,5 +62,3 @@ MONO_API_FUNCTION(MONO_API void, mono_stack_walk_no_il, (MonoStackWalk func, voi
 MONO_API_FUNCTION(MONO_API void, mono_stack_walk_async_safe, (MonoStackWalkAsyncSafe func, void *initial_sig_context, void* user_data))
 
 MONO_API_FUNCTION(MONO_API MonoMethodHeader*, mono_method_get_header_checked, (MonoMethod *method, MonoError *error))
-
-
diff --git a/src/native/public/mono/metadata/details/mono-config-functions.h b/src/native/public/mono/metadata/details/mono-config-functions.h
index 49108de4d7bd11..fbb445fde66d8e 100644
--- a/src/native/public/mono/metadata/details/mono-config-functions.h
+++ b/src/native/public/mono/metadata/details/mono-config-functions.h
@@ -24,5 +24,3 @@ MONO_API_FUNCTION(MONO_API const char*, mono_config_string_for_assembly_file, (c
 
 MONO_API_FUNCTION(MONO_API void, mono_config_set_server_mode, (mono_bool server_mode))
 MONO_API_FUNCTION(MONO_API mono_bool, mono_config_is_server_mode, (void))
-
-
diff --git a/src/native/public/mono/metadata/details/mono-debug-functions.h b/src/native/public/mono/metadata/details/mono-debug-functions.h
index 427a4b30e4019c..a77443b88bab6a 100644
--- a/src/native/public/mono/metadata/details/mono-debug-functions.h
+++ b/src/native/public/mono/metadata/details/mono-debug-functions.h
@@ -63,4 +63,3 @@ MONO_API_FUNCTION(MONO_API int, mono_debugger_insert_breakpoint, (const char *me
 
 MONO_API_FUNCTION(MONO_API void, mono_set_is_debugger_attached, (mono_bool attached))
 MONO_API_FUNCTION(MONO_API mono_bool, mono_is_debugger_attached, (void))
-
diff --git a/src/native/public/mono/metadata/details/mono-gc-functions.h b/src/native/public/mono/metadata/details/mono-gc-functions.h
index 0881c8e18e4273..3204b756b85db8 100644
--- a/src/native/public/mono/metadata/details/mono-gc-functions.h
+++ b/src/native/public/mono/metadata/details/mono-gc-functions.h
@@ -20,4 +20,3 @@ MONO_API_FUNCTION(MONO_API int, mono_gc_invoke_finalizers, (void))
 MONO_API_FUNCTION(MONO_API int, mono_gc_walk_heap, (int flags, MonoGCReferences callback, void *data))
 
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_init_finalizer_thread, (void))
-
diff --git a/src/native/public/mono/metadata/details/mono-private-unstable-functions.h b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
index ac2a9bb24c10a1..3a902ee118f4d3 100644
--- a/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
+++ b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
@@ -18,4 +18,3 @@ MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssemblyLoadContextGCHandle
 MONO_API_FUNCTION(MONO_API void, mono_register_bundled_satellite_assemblies, (const MonoBundledSatelliteAssembly **assemblies))
 
 MONO_API_FUNCTION(MONO_API MonoBundledSatelliteAssembly *, mono_create_new_bundled_satellite_assembly, (const char *name, const char *culture, const unsigned char *data, unsigned int size))
-
diff --git a/src/native/public/mono/metadata/details/object-functions.h b/src/native/public/mono/metadata/details/object-functions.h
index 38c5a74c5e02d4..9cf277e9b2a54a 100644
--- a/src/native/public/mono/metadata/details/object-functions.h
+++ b/src/native/public/mono/metadata/details/object-functions.h
@@ -221,4 +221,3 @@ MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_nostore, (void* ptr))
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_value_copy, (void* dest, /*const*/ void* src, int count, MonoClass *klass))
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_object_copy, (MonoObject* obj, MonoObject *src))
-
diff --git a/src/native/public/mono/metadata/details/opcodes-functions.h b/src/native/public/mono/metadata/details/opcodes-functions.h
index 55e023a959a9dc..c63a5c427945c2 100644
--- a/src/native/public/mono/metadata/details/opcodes-functions.h
+++ b/src/native/public/mono/metadata/details/opcodes-functions.h
@@ -9,4 +9,3 @@
 MONO_API_FUNCTION(MONO_API const char*, mono_opcode_name, (int opcode))
 
 MONO_API_FUNCTION(MONO_API MonoOpcodeEnum, mono_opcode_value, (const mono_byte **ip, const mono_byte *end))
-
diff --git a/src/native/public/mono/metadata/details/reflection-functions.h b/src/native/public/mono/metadata/details/reflection-functions.h
index 21f025ebafe91e..5cb0efef7efb4c 100644
--- a/src/native/public/mono/metadata/details/reflection-functions.h
+++ b/src/native/public/mono/metadata/details/reflection-functions.h
@@ -62,5 +62,3 @@ MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_assembly_action, (MonoA
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_get_type, (MonoReflectionType *reftype))
 
 MONO_API_FUNCTION(MONO_API MonoAssembly*, mono_reflection_assembly_get_assembly, (MonoReflectionAssembly *refassembly))
-
-
diff --git a/src/native/public/mono/metadata/details/sgen-bridge-functions.h b/src/native/public/mono/metadata/details/sgen-bridge-functions.h
index a8f1aa4fe662ee..877bf3aa400106 100644
--- a/src/native/public/mono/metadata/details/sgen-bridge-functions.h
+++ b/src/native/public/mono/metadata/details/sgen-bridge-functions.h
@@ -14,6 +14,3 @@
 MONO_API_FUNCTION(MONO_API void, mono_gc_register_bridge_callbacks, (MonoGCBridgeCallbacks *callbacks))
 
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wait_for_bridge_processing, (void))
-
-
-
diff --git a/src/native/public/mono/metadata/details/threads-functions.h b/src/native/public/mono/metadata/details/threads-functions.h
index 214bf81196df9b..37d10e740f9148 100644
--- a/src/native/public/mono/metadata/details/threads-functions.h
+++ b/src/native/public/mono/metadata/details/threads-functions.h
@@ -40,4 +40,3 @@ MONO_API_FUNCTION(MONO_API void, mono_threads_request_thread_dump, (void))
 MONO_API_FUNCTION(MONO_API mono_bool, mono_thread_is_foreign, (MonoThread *thread))
 
 MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_thread_detach_if_exiting, (void))
-
diff --git a/src/native/public/mono/utils/details/mono-counters-functions.h b/src/native/public/mono/utils/details/mono-counters-functions.h
index b5073edb16f97f..5f6486f2311001 100644
--- a/src/native/public/mono/utils/details/mono-counters-functions.h
+++ b/src/native/public/mono/utils/details/mono-counters-functions.h
@@ -40,6 +40,3 @@ MONO_API_FUNCTION(MONO_API size_t, mono_counter_get_size, (MonoCounter *counter)
 MONO_API_FUNCTION(MONO_API int,  mono_runtime_resource_limit, (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit))
 MONO_API_FUNCTION(MONO_API void, mono_runtime_resource_set_callback, (MonoResourceCallback callback))
 MONO_API_FUNCTION(MONO_API void, mono_runtime_resource_check_limit,  (int resource_type, uintptr_t value))
-
-
-
diff --git a/src/native/public/mono/utils/details/mono-dl-fallback-functions.h b/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
index 84cd5696a4ffdc..67733c790cca35 100644
--- a/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
+++ b/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
@@ -9,5 +9,3 @@
 MONO_API_FUNCTION(MONO_API MonoDlFallbackHandler *, mono_dl_fallback_register, (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func, \
 										MonoDlFallbackClose close_func, void *user_data))
 MONO_API_FUNCTION(MONO_API void, mono_dl_fallback_unregister, (MonoDlFallbackHandler *handler))
-
-
diff --git a/src/native/public/mono/utils/details/mono-error-functions.h b/src/native/public/mono/utils/details/mono-error-functions.h
index f7a4b505982bf2..a5f1ec10c41fab 100644
--- a/src/native/public/mono/utils/details/mono-error-functions.h
+++ b/src/native/public/mono/utils/details/mono-error-functions.h
@@ -16,5 +16,3 @@ MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_error_ok, (Mono
 MONO_API_FUNCTION(MONO_API unsigned short, mono_error_get_error_code, (MonoError *error))
 
 MONO_API_FUNCTION(MONO_API const char*, mono_error_get_message, (MonoError *error))
-
-
diff --git a/src/native/public/mono/utils/details/mono-logger-functions.h b/src/native/public/mono/utils/details/mono-logger-functions.h
index 63a57c05197138..8c91f13b9047fa 100644
--- a/src/native/public/mono/utils/details/mono-logger-functions.h
+++ b/src/native/public/mono/utils/details/mono-logger-functions.h
@@ -15,5 +15,3 @@ MONO_API_FUNCTION(MONO_API void, mono_trace_set_log_handler, (MonoLogCallback ca
 MONO_API_FUNCTION(MONO_API void, mono_trace_set_print_handler, (MonoPrintCallback callback))
 
 MONO_API_FUNCTION(MONO_API void, mono_trace_set_printerr_handler, (MonoPrintCallback callback))
-
-

From 409ca9efa68d6d80a25fad60d4e4a94c06f1d4f0 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Fri, 18 Feb 2022 16:33:09 -0500
Subject: [PATCH 08/14] Add needed includes

---
 src/mono/wasm/runtime/corebindings.c          | 4 ++++
 src/mono/wasm/runtime/driver.c                | 4 ++++
 src/tasks/AppleAppBuilder/Templates/runtime.m | 3 +++
 3 files changed, 11 insertions(+)

diff --git a/src/mono/wasm/runtime/corebindings.c b/src/mono/wasm/runtime/corebindings.c
index fbfb5c42017986..3f9c744e6d6029 100644
--- a/src/mono/wasm/runtime/corebindings.c
+++ b/src/mono/wasm/runtime/corebindings.c
@@ -7,6 +7,10 @@
 #include <stdint.h>
 #include <assert.h>
 
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/class.h>
+#include <mono/metadata/loader.h>
+#include <mono/metadata/object.h>
 #include <mono/jit/jit.h>
 
 //JS funcs
diff --git a/src/mono/wasm/runtime/driver.c b/src/mono/wasm/runtime/driver.c
index cabdb8408ce119..146c9dfb9cf9e9 100644
--- a/src/mono/wasm/runtime/driver.c
+++ b/src/mono/wasm/runtime/driver.c
@@ -9,11 +9,15 @@
 #include <dlfcn.h>
 #include <sys/stat.h>
 
+#include <mono/metadata/appdomain.h>
 #include <mono/metadata/assembly.h>
+#include <mono/metadata/class.h>
 #include <mono/metadata/tokentype.h>
 #include <mono/metadata/threads.h>
 #include <mono/metadata/image.h>
+#include <mono/metadata/loader.h>
 #include <mono/metadata/mono-gc.h>
+#include <mono/metadata/object.h>
 // FIXME: unavailable in emscripten
 // #include <mono/metadata/gc-internals.h>
 
diff --git a/src/tasks/AppleAppBuilder/Templates/runtime.m b/src/tasks/AppleAppBuilder/Templates/runtime.m
index 5a76abd5891957..1d1459a1fd30b5 100644
--- a/src/tasks/AppleAppBuilder/Templates/runtime.m
+++ b/src/tasks/AppleAppBuilder/Templates/runtime.m
@@ -5,9 +5,12 @@
 #include <mono/utils/mono-publib.h>
 #include <mono/utils/mono-logger.h>
 #include <mono/metadata/assembly.h>
+#include <mono/metadata/appdomain.h>
+#include <mono/metadata/class.h>
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/mono-gc.h>
 #include <mono/metadata/exception.h>
+#include <mono/metadata/object.h>
 #include <mono/jit/jit.h>
 #include <mono/jit/mono-private-unstable.h>
 #include <TargetConditionals.h>

From bd6de7edaeca7c72b17ef5cff7f02e58972ef9a1 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Tue, 22 Feb 2022 16:15:03 -0500
Subject: [PATCH 09/14] add unstable API comment to the details headers, too

---
 .../mono/jit/details/mono-private-unstable-functions.h    | 8 ++++++++
 .../public/mono/jit/details/mono-private-unstable-types.h | 8 ++++++++
 .../metadata/details/mono-private-unstable-functions.h    | 8 ++++++++
 .../mono/metadata/details/mono-private-unstable-types.h   | 8 ++++++++
 4 files changed, 32 insertions(+)

diff --git a/src/native/public/mono/jit/details/mono-private-unstable-functions.h b/src/native/public/mono/jit/details/mono-private-unstable-functions.h
index bedd7b65307c95..f703952037a09f 100644
--- a/src/native/public/mono/jit/details/mono-private-unstable-functions.h
+++ b/src/native/public/mono/jit/details/mono-private-unstable-functions.h
@@ -1,6 +1,14 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 //
+/**
+ *
+ * Private unstable APIs.
+ *
+ * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at
+ * any time.
+ *
+ */
 // This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
 #ifndef MONO_API_FUNCTION
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
diff --git a/src/native/public/mono/jit/details/mono-private-unstable-types.h b/src/native/public/mono/jit/details/mono-private-unstable-types.h
index 252bc01b405dbc..cbcb9e9733b781 100644
--- a/src/native/public/mono/jit/details/mono-private-unstable-types.h
+++ b/src/native/public/mono/jit/details/mono-private-unstable-types.h
@@ -1,6 +1,14 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 //
+/**
+ *
+ * Private unstable APIs.
+ *
+ * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at
+ * any time.
+ *
+ */
 #ifndef _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H
 #define _MONO_JIT_PRIVATE_UNSTABLE_TYPES_H
 
diff --git a/src/native/public/mono/metadata/details/mono-private-unstable-functions.h b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
index 3a902ee118f4d3..2b6cc9107747e9 100644
--- a/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
+++ b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
@@ -1,6 +1,14 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 //
+/**
+ *
+ * Private unstable APIs.
+ *
+ * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at
+ * any time.
+ *
+ */
 // This file does not have ifdef guards, it is meant to be included multiple times with different definitions of MONO_API_FUNCTION
 #ifndef MONO_API_FUNCTION
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
diff --git a/src/native/public/mono/metadata/details/mono-private-unstable-types.h b/src/native/public/mono/metadata/details/mono-private-unstable-types.h
index efd133a64f5209..c66bd7809dcd92 100644
--- a/src/native/public/mono/metadata/details/mono-private-unstable-types.h
+++ b/src/native/public/mono/metadata/details/mono-private-unstable-types.h
@@ -1,6 +1,14 @@
 // Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 //
+/**
+ *
+ * Private unstable APIs.
+ *
+ * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at
+ * any time.
+ *
+ */
 #ifndef _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H
 #define _MONO_METADATA_PRIVATE_UNSTABLE_TYPES_H
 

From 116c1b41b7a01536db38dc3c30c543a69db4ccfa Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Tue, 22 Feb 2022 16:34:40 -0500
Subject: [PATCH 10/14] use install(FILES) to copy only the headers

not other stray files to the include dir
---
 src/native/public/monoapi.cmake | 37 +++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/src/native/public/monoapi.cmake b/src/native/public/monoapi.cmake
index e09a0028d05dcf..039896cf404f0e 100644
--- a/src/native/public/monoapi.cmake
+++ b/src/native/public/monoapi.cmake
@@ -10,6 +10,8 @@ set(utils_public_headers_base
     mono-dl-fallback.h
     mono-private-unstable.h
     mono-counters.h
+    )
+set(utils_public_headers_details_base
     details/mono-publib-types.h
     details/mono-publib-functions.h
     details/mono-logger-types.h
@@ -21,14 +23,13 @@ set(utils_public_headers_base
     details/mono-counters-types.h
     details/mono-counters-functions.h
     )
-addprefix(utils_public_headers ./mono/utils "${utils_public_headers_base}")
+addprefix(utils_public_headers mono/utils "${utils_public_headers_base}")
+addprefix(utils_public_headers_details mono/utils "${utils_public_headers_details_base}")
 
-target_sources(monoapi_utils INTERFACE ${utils_public_headers})
+target_sources(monoapi_utils INTERFACE ${utils_public_headers} ${utils_public_headers_details})
 
 target_include_directories(monoapi_utils INTERFACE .)
 
-set_target_properties(monoapi_utils PROPERTIES PUBLIC_HEADER "${utils_public_headers}")
-
 add_library(monoapi_metadata INTERFACE)
 
 set(metadata_public_headers_base
@@ -59,6 +60,8 @@ set(metadata_public_headers_base
 	threads.h
 	tokentype.h
 	verify.h
+	)
+set(metadata_public_headers_details_base
 	details/environment-functions.h
 	details/opcodes-types.h
 	details/opcodes-functions.h
@@ -97,29 +100,41 @@ set(metadata_public_headers_base
 	details/mono-private-unstable-types.h
 	details/mono-private-unstable-functions.h
 	)
-addprefix(metadata_public_headers ./mono/metadata/ "${metadata_public_headers_base}")
+addprefix(metadata_public_headers mono/metadata "${metadata_public_headers_base}")
+addprefix(metadata_public_headers_details mono/metadata "${metadata_public_headers_details_base}")
+
+target_sources(monoapi_metadata INTERFACE ${metadata_public_headers} ${metadata_public_headers_details})
 
-set_target_properties(monoapi_metadata PROPERTIES PUBLIC_HEADER "${metadata_public_headers}")
+target_include_directories(monoapi_metadata INTERFACE .)
 
 add_library(monoapi_jit INTERFACE)
 
 set(jit_public_headers_base
   jit.h
   mono-private-unstable.h
+  )
+set(jit_public_headers_details_base
   details/jit-types.h
   details/jit-functions.h
   details/mono-private-unstable-types.h
   details/mono-private-unstable-functions.h
   )
-addprefix(jit_public_headers ./mono/jit "${jit_public_headers_base}")
+addprefix(jit_public_headers mono/jit "${jit_public_headers_base}")
+addprefix(jit_public_headers_details mono/jit "${jit_public_headers_details_base}")
+
+target_sources(monoapi_jit INTERFACE ${jit_public_headers} ${jit_public_headers_details})
+
+target_include_directories(monoapi_jit INTERFACE .)
 
-set_target_properties(monoapi_jit PROPERTIES PUBLIC_HEADER "${jit_public_headers}")
 
 add_library(monoapi INTERFACE)
 target_link_libraries(monoapi INTERFACE monoapi_utils monoapi_metadata monoapi_jit)
 
 if(INSTALL_MONO_API)
-  install(DIRECTORY mono/utils/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/utils)
-  install(DIRECTORY mono/metadata/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/metadata)
-  install(DIRECTORY mono/jit/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit)
+  install(FILES ${utils_public_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/utils)
+  install(FILES ${utils_public_headers_details} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/utils/details)
+  install(FILES ${metadata_public_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/metadata)
+  install(FILES ${metadata_public_headers_details} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/metadata/details)
+  install(FILES ${jit_public_headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit)
+  install(FILES ${jit_public_headers_details} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit/details)
 endif()

From 7e5fe2c9b3aebb359ef08f057f22b2a06a9c9bc7 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Tue, 22 Feb 2022 16:46:30 -0500
Subject: [PATCH 11/14] update CODEOWNERS

---
 .github/CODEOWNERS | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 1c41d9d4e873d6..926d1818c771f5 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -59,6 +59,8 @@
 
 /src/mono/dlls @thaystg @lambdageek
 
+/src/native/public/mono @marek-safar @lambdageek
+
 # Obsoletions / Custom Diagnostics
 
 /docs/project/list-of-diagnostics.md                @jeffhandley

From 97733851d5fe673e7a2482b6c3644dcc4cd0de6f Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Wed, 23 Feb 2022 12:54:59 -0500
Subject: [PATCH 12/14] Remove duplicate definitions of
 mono_event_get_remove_method

This was already duplicated before the header reorganization,
e.g. here https://github.com/dotnet/runtime/blob/b9a55b4f52243325359ced26e3d4b31ccacdc381/src/native/public/mono/metadata/class.h#L279-L282
---
 src/native/public/mono/metadata/details/class-functions.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/native/public/mono/metadata/details/class-functions.h b/src/native/public/mono/metadata/details/class-functions.h
index 856c8d82d24fdb..086cf9a303c63e 100644
--- a/src/native/public/mono/metadata/details/class-functions.h
+++ b/src/native/public/mono/metadata/details/class-functions.h
@@ -162,8 +162,6 @@ MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_add_method, (MonoEvent *e
 
 MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_remove_method, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_remove_method, (MonoEvent *event))
-
 MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_raise_method, (MonoEvent *event))
 
 MONO_API_FUNCTION(MONO_API MonoClass*, mono_event_get_parent, (MonoEvent *event))

From c102e9cbf793d7dfe5c6e8fd8562a3666572ab73 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Wed, 23 Feb 2022 14:16:53 -0500
Subject: [PATCH 13/14] remove MONO_API modifier from *-functions.h

---
 .../public/mono/jit/details/jit-functions.h   |  34 +--
 .../details/mono-private-unstable-functions.h |  10 +-
 .../metadata/details/appdomain-functions.h    | 130 +++++------
 .../metadata/details/assembly-functions.h     |  98 ++++-----
 .../mono/metadata/details/class-functions.h   | 170 +++++++--------
 .../details/debug-helpers-functions.h         |  34 +--
 .../metadata/details/environment-functions.h  |   4 +-
 .../metadata/details/exception-functions.h    |  88 ++++----
 .../mono/metadata/details/image-functions.h   |  88 ++++----
 .../mono/metadata/details/loader-functions.h  |  56 ++---
 .../metadata/details/metadata-functions.h     | 174 +++++++--------
 .../metadata/details/mono-config-functions.h  |  26 +--
 .../metadata/details/mono-debug-functions.h   |  52 ++---
 .../mono/metadata/details/mono-gc-functions.h |  24 +-
 .../details/mono-private-unstable-functions.h |  12 +-
 .../mono/metadata/details/object-functions.h  | 206 +++++++++---------
 .../mono/metadata/details/opcodes-functions.h |   4 +-
 .../metadata/details/profiler-functions.h     |  36 +--
 .../metadata/details/reflection-functions.h   |  90 ++++----
 .../metadata/details/sgen-bridge-functions.h  |   4 +-
 .../mono/metadata/details/threads-functions.h |  42 ++--
 .../utils/details/mono-counters-functions.h   |  36 +--
 .../details/mono-dl-fallback-functions.h      |   4 +-
 .../mono/utils/details/mono-error-functions.h |  12 +-
 .../utils/details/mono-logger-functions.h     |  10 +-
 .../utils/details/mono-publib-functions.h     |   4 +-
 26 files changed, 724 insertions(+), 724 deletions(-)

diff --git a/src/native/public/mono/jit/details/jit-functions.h b/src/native/public/mono/jit/details/jit-functions.h
index 00076685107c99..43e3b0e266756f 100644
--- a/src/native/public/mono/jit/details/jit-functions.h
+++ b/src/native/public/mono/jit/details/jit-functions.h
@@ -6,42 +6,42 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init, (const char *file))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init, (const char *file))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init_version, (const char *root_domain_name, const char *runtime_version))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_jit_init_version, (const char *root_domain_name, const char *runtime_version))
 
-MONO_API_FUNCTION(MONO_API MonoDomain *, mono_jit_init_version_for_test_only, (const char *root_domain_name, const char *runtime_version))
+MONO_API_FUNCTION(MonoDomain *, mono_jit_init_version_for_test_only, (const char *root_domain_name, const char *runtime_version))
 
-MONO_API_FUNCTION(MONO_API int, mono_jit_exec, (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]))
-MONO_API_FUNCTION(MONO_API void, mono_jit_cleanup, (MonoDomain *domain))
+MONO_API_FUNCTION(int, mono_jit_exec, (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]))
+MONO_API_FUNCTION(void, mono_jit_cleanup, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_jit_set_trace_options, (const char* options))
+MONO_API_FUNCTION(mono_bool, mono_jit_set_trace_options, (const char* options))
 
-MONO_API_FUNCTION(MONO_API void, mono_set_signal_chaining, (mono_bool chain_signals))
+MONO_API_FUNCTION(void, mono_set_signal_chaining, (mono_bool chain_signals))
 
-MONO_API_FUNCTION(MONO_API void, mono_set_crash_chaining, (mono_bool chain_signals))
+MONO_API_FUNCTION(void, mono_set_crash_chaining, (mono_bool chain_signals))
 
 /**
  * This function is deprecated, use mono_jit_set_aot_mode instead.
  */
-MONO_API_FUNCTION(MONO_API void, mono_jit_set_aot_only, (mono_bool aot_only))
+MONO_API_FUNCTION(void, mono_jit_set_aot_only, (mono_bool aot_only))
 
-MONO_API_FUNCTION(MONO_API void, mono_jit_set_aot_mode, (MonoAotMode mode))
+MONO_API_FUNCTION(void, mono_jit_set_aot_mode, (MonoAotMode mode))
 
 /*
  * Returns whether the runtime was invoked for the purpose of AOT-compiling an
  * assembly, i.e. no managed code will run.
  */
-MONO_API_FUNCTION(MONO_API mono_bool, mono_jit_aot_compiling, (void))
+MONO_API_FUNCTION(mono_bool, mono_jit_aot_compiling, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_set_break_policy, (MonoBreakPolicyFunc policy_callback))
+MONO_API_FUNCTION(void, mono_set_break_policy, (MonoBreakPolicyFunc policy_callback))
 
-MONO_API_FUNCTION(MONO_API void, mono_jit_parse_options, (int argc, char * argv[]))
+MONO_API_FUNCTION(void, mono_jit_parse_options, (int argc, char * argv[]))
 
-MONO_API_FUNCTION(MONO_API char*, mono_get_runtime_build_info, (void))
+MONO_API_FUNCTION(char*, mono_get_runtime_build_info, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_set_use_llvm, (mono_bool use_llvm))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_set_use_llvm, (mono_bool use_llvm))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_aot_register_module, (void **aot_info))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_aot_register_module, (void **aot_info))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_jit_thread_attach, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_jit_thread_attach, (MonoDomain *domain))
diff --git a/src/native/public/mono/jit/details/mono-private-unstable-functions.h b/src/native/public/mono/jit/details/mono-private-unstable-functions.h
index f703952037a09f..04076d5e1efdc0 100644
--- a/src/native/public/mono/jit/details/mono-private-unstable-functions.h
+++ b/src/native/public/mono/jit/details/mono-private-unstable-functions.h
@@ -14,15 +14,15 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_load_aot_data_hook, (MonoLoadAotDataFunc load_func, MonoFreeAotDataFunc free_func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_load_aot_data_hook, (MonoLoadAotDataFunc load_func, MonoFreeAotDataFunc free_func, void* user_data))
 
-MONO_API_FUNCTION(MONO_API int, monovm_initialize, (int propertyCount, const char **propertyKeys, const char **propertyValues))
+MONO_API_FUNCTION(int, monovm_initialize, (int propertyCount, const char **propertyKeys, const char **propertyValues))
 
-MONO_API_FUNCTION(MONO_API int, monovm_runtimeconfig_initialize, (MonovmRuntimeConfigArguments *arg, MonovmRuntimeConfigArgumentsCleanup cleanup_fn, void *user_data))
+MONO_API_FUNCTION(int, monovm_runtimeconfig_initialize, (MonovmRuntimeConfigArguments *arg, MonovmRuntimeConfigArgumentsCleanup cleanup_fn, void *user_data))
 
 // The wrapper MonoCoreRuntimeProperties struct can be stack-allocated or freed, but the structs inside it _must_ be heap-allocated and never freed, as they are not copied to avoid extra allocations
-MONO_API_FUNCTION(MONO_API int, monovm_initialize_preparsed, (MonoCoreRuntimeProperties *parsed_properties, int propertyCount, const char **propertyKeys, const char **propertyValues))
+MONO_API_FUNCTION(int, monovm_initialize_preparsed, (MonoCoreRuntimeProperties *parsed_properties, int propertyCount, const char **propertyKeys, const char **propertyValues))
 
 //#ifdef HOST_WASM
-MONO_API_FUNCTION(MONO_API void, mono_wasm_install_get_native_to_interp_tramp, (MonoWasmGetNativeToInterpTramp cb))
+MONO_API_FUNCTION(void, mono_wasm_install_get_native_to_interp_tramp, (MonoWasmGetNativeToInterpTramp cb))
 //#endif
diff --git a/src/native/public/mono/metadata/details/appdomain-functions.h b/src/native/public/mono/metadata/details/appdomain-functions.h
index 49625f81f5980b..056c4e05788510 100644
--- a/src/native/public/mono/metadata/details/appdomain-functions.h
+++ b/src/native/public/mono/metadata/details/appdomain-functions.h
@@ -6,135 +6,135 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MonoDomain*, mono_init, (const char *filename))
+MONO_API_FUNCTION(MonoDomain*, mono_init, (const char *filename))
 
-MONO_API_FUNCTION(MONO_API MonoDomain *, mono_init_from_assembly, (const char *domain_name, const char *filename))
+MONO_API_FUNCTION(MonoDomain *, mono_init_from_assembly, (const char *domain_name, const char *filename))
 
-MONO_API_FUNCTION(MONO_API MonoDomain *, mono_init_version, (const char *domain_name, const char *version))
+MONO_API_FUNCTION(MonoDomain *, mono_init_version, (const char *domain_name, const char *version))
 
-MONO_API_FUNCTION(MONO_API MonoDomain*, mono_get_root_domain, (void))
+MONO_API_FUNCTION(MonoDomain*, mono_get_root_domain, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_init, (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_init, (MonoDomain *domain, MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_cleanup, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_cleanup, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API void, mono_install_runtime_cleanup, (MonoDomainFunc func))
+MONO_API_FUNCTION(void, mono_install_runtime_cleanup, (MonoDomainFunc func))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_quit, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_quit, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_runtime_set_shutting_down, (void))
+MONO_API_FUNCTION(void, mono_runtime_set_shutting_down, (void))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_runtime_is_shutting_down, (void))
+MONO_API_FUNCTION(mono_bool, mono_runtime_is_shutting_down, (void))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_check_corlib_version, (void))
+MONO_API_FUNCTION(const char*, mono_check_corlib_version, (void))
 
-MONO_API_FUNCTION(MONO_API MonoDomain *, mono_domain_create, (void))
+MONO_API_FUNCTION(MonoDomain *, mono_domain_create, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_create_appdomain, (char *friendly_name, char *configuration_file))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_create_appdomain, (char *friendly_name, char *configuration_file))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_set_config, (MonoDomain *domain, const char *base_dir, const char *config_file_name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_set_config, (MonoDomain *domain, const char *base_dir, const char *config_file_name))
 
-MONO_API_FUNCTION(MONO_API MonoDomain *, mono_domain_get, (void))
+MONO_API_FUNCTION(MonoDomain *, mono_domain_get, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_get_by_id, (int32_t domainid))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_get_by_id, (int32_t domainid))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int32_t, mono_domain_get_id, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int32_t, mono_domain_get_id, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char *, mono_domain_get_friendly_name, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char *, mono_domain_get_friendly_name, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_set, (MonoDomain *domain, mono_bool force))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_set, (MonoDomain *domain, mono_bool force))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_set_internal, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_set_internal, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_unload, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_unload, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_try_unload, (MonoDomain *domain, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_try_unload, (MonoDomain *domain, MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_is_unloading, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_is_unloading, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_from_appdomain, (MonoAppDomain *appdomain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain *, mono_domain_from_appdomain, (MonoAppDomain *appdomain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_foreach, (MonoDomainFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_foreach, (MonoDomainFunc func, void* user_data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_domain_assembly_open, (MonoDomain *domain, const char *name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_domain_assembly_open, (MonoDomain *domain, const char *name))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_ensure_entry_assembly, (MonoDomain *domain, MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_ensure_entry_assembly, (MonoDomain *domain, MonoAssembly *assembly))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_finalize, (MonoDomain *domain, uint32_t timeout))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_finalize, (MonoDomain *domain, uint32_t timeout))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_domain_free, (MonoDomain *domain, mono_bool force))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_domain_free, (MonoDomain *domain, mono_bool force))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_domain_has_type_resolve, (MonoDomain *domain))
+MONO_API_FUNCTION(mono_bool, mono_domain_has_type_resolve, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly *, mono_domain_try_type_resolve, (MonoDomain *domain, char *name, MonoObject *tb))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly *, mono_domain_try_type_resolve, (MonoDomain *domain, char *name, MonoObject *tb))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_owns_vtable_slot, (MonoDomain *domain, void* vtable_slot))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_domain_owns_vtable_slot, (MonoDomain *domain, void* vtable_slot))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_context_init, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_context_init, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_context_set, (MonoAppContext *new_context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_context_set, (MonoAppContext *new_context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAppContext *, mono_context_get, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAppContext *, mono_context_get, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_id, (MonoAppContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_id, (MonoAppContext *context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_domain_id, (MonoAppContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int32_t, mono_context_get_domain_id, (MonoAppContext *context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoJitInfo *, mono_jit_info_table_find, (MonoDomain *domain, void* addr))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoJitInfo *, mono_jit_info_table_find, (MonoDomain *domain, void* addr))
 
 /* MonoJitInfo accessors */
 
-MONO_API_FUNCTION(MONO_API void*, mono_jit_info_get_code_start, (MonoJitInfo* ji))
+MONO_API_FUNCTION(void*, mono_jit_info_get_code_start, (MonoJitInfo* ji))
 
-MONO_API_FUNCTION(MONO_API int, mono_jit_info_get_code_size, (MonoJitInfo* ji))
+MONO_API_FUNCTION(int, mono_jit_info_get_code_size, (MonoJitInfo* ji))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_jit_info_get_method, (MonoJitInfo* ji))
+MONO_API_FUNCTION(MonoMethod*, mono_jit_info_get_method, (MonoJitInfo* ji))
 
 
-MONO_API_FUNCTION(MONO_API MonoImage*, mono_get_corlib, (void))
+MONO_API_FUNCTION(MonoImage*, mono_get_corlib, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_object_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_object_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_byte_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_byte_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_void_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_void_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_boolean_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_boolean_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_sbyte_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_sbyte_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_int16_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_int16_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uint16_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_uint16_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_int32_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_int32_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uint32_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_uint32_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_intptr_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_intptr_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uintptr_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_uintptr_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_int64_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_int64_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_uint64_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_uint64_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_single_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_single_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_double_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_double_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_char_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_char_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_string_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_string_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_enum_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_enum_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_array_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_array_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_thread_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_thread_class, (void))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_get_exception_class, (void))
+MONO_API_FUNCTION(MonoClass*, mono_get_exception_class, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_security_enable_core_clr, (void))
+MONO_API_FUNCTION(void, mono_security_enable_core_clr, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_security_set_core_clr_platform_callback, (MonoCoreClrPlatformCB callback))
+MONO_API_FUNCTION(void, mono_security_set_core_clr_platform_callback, (MonoCoreClrPlatformCB callback))
diff --git a/src/native/public/mono/metadata/details/assembly-functions.h b/src/native/public/mono/metadata/details/assembly-functions.h
index c6c14619edbfa8..729a9dffdab5e1 100644
--- a/src/native/public/mono/metadata/details/assembly-functions.h
+++ b/src/native/public/mono/metadata/details/assembly-functions.h
@@ -6,70 +6,70 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_assemblies_init, (void))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_assemblies_cleanup, (void))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open, (const char *filename, MonoImageOpenStatus *status))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open_full, (const char *filename, MonoImageOpenStatus *status, mono_bool refonly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_full, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status, mono_bool refonly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from,  (MonoImage *image, const char *fname, MonoImageOpenStatus *status))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from_full, (MonoImage *image, const char *fname, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(void, mono_assemblies_init, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_assemblies_cleanup, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open, (const char *filename, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_open_full, (const char *filename, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_full, (MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from,  (MonoImage *image, const char *fname, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_from_full, (MonoImage *image, const char *fname, MonoImageOpenStatus *status, mono_bool refonly))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_with_partial_name, (const char *name, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_load_with_partial_name, (const char *name, MonoImageOpenStatus *status))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded, (MonoAssemblyName *aname))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded_full, (MonoAssemblyName *aname, mono_bool refonly))
-MONO_API_FUNCTION(MONO_API void, mono_assembly_get_assemblyref, (MonoImage *image, int index, MonoAssemblyName *aname))
-MONO_API_FUNCTION(MONO_API void, mono_assembly_load_reference, (MonoImage *image, int index))
-MONO_API_FUNCTION(MONO_API void, mono_assembly_load_references, (MonoImage *image, MonoImageOpenStatus *status))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*, mono_assembly_load_module, (MonoAssembly *assembly, uint32_t idx))
-MONO_API_FUNCTION(MONO_API void, mono_assembly_close, (MonoAssembly *assembly))
-MONO_API_FUNCTION(MONO_API void, mono_assembly_setrootdir, (const char *root_dir))
-MONO_API_FUNCTION(MONO_API MONO_CONST_RETURN char *, mono_assembly_getrootdir, (void))
-MONO_API_FUNCTION(MONO_API char *, mono_native_getrootdir, (void))
-MONO_API_FUNCTION(MONO_API void, mono_assembly_foreach, (MonoFunc func, void* user_data))
-MONO_API_FUNCTION(MONO_API void, mono_assembly_set_main, (MonoAssembly *assembly))
-MONO_API_FUNCTION(MONO_API MonoAssembly *, mono_assembly_get_main, (void))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_assembly_get_image, (MonoAssembly *assembly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssemblyName *, mono_assembly_get_name, (MonoAssembly *assembly))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_assembly_fill_assembly_name, (MonoImage *image, MonoAssemblyName *aname))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_assembly_names_equal, (MonoAssemblyName *l, MonoAssemblyName *r))
-MONO_API_FUNCTION(MONO_API char*, mono_stringify_assembly_name, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_loaded_full, (MonoAssemblyName *aname, mono_bool refonly))
+MONO_API_FUNCTION(void, mono_assembly_get_assemblyref, (MonoImage *image, int index, MonoAssemblyName *aname))
+MONO_API_FUNCTION(void, mono_assembly_load_reference, (MonoImage *image, int index))
+MONO_API_FUNCTION(void, mono_assembly_load_references, (MonoImage *image, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage*, mono_assembly_load_module, (MonoAssembly *assembly, uint32_t idx))
+MONO_API_FUNCTION(void, mono_assembly_close, (MonoAssembly *assembly))
+MONO_API_FUNCTION(void, mono_assembly_setrootdir, (const char *root_dir))
+MONO_API_FUNCTION(MONO_CONST_RETURN char *, mono_assembly_getrootdir, (void))
+MONO_API_FUNCTION(char *, mono_native_getrootdir, (void))
+MONO_API_FUNCTION(void, mono_assembly_foreach, (MonoFunc func, void* user_data))
+MONO_API_FUNCTION(void, mono_assembly_set_main, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MonoAssembly *, mono_assembly_get_main, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_assembly_get_image, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssemblyName *, mono_assembly_get_name, (MonoAssembly *assembly))
+MONO_API_FUNCTION(mono_bool, mono_assembly_fill_assembly_name, (MonoImage *image, MonoAssemblyName *aname))
+MONO_API_FUNCTION(mono_bool, mono_assembly_names_equal, (MonoAssemblyName *l, MonoAssemblyName *r))
+MONO_API_FUNCTION(char*, mono_stringify_assembly_name, (MonoAssemblyName *aname))
 
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_load_hook, (MonoAssemblyLoadFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_load_hook, (MonoAssemblyLoadFunc func, void* user_data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_invoke_search_hook, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly*, mono_assembly_invoke_search_hook, (MonoAssemblyName *aname))
 
 /*
  * Installs a new search function which is used as a last resort when loading
  * an assembly fails. This could invoke AssemblyResolve events.
  */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_search_hook, (MonoAssemblySearchFunc func, void* user_data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_postload_refonly_search_hook, (MonoAssemblySearchFunc func, void* user_data))
 
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_refonly_preload_hook, (MonoAssemblyPreLoadFunc func, void* user_data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_assembly_invoke_load_hook, (MonoAssembly *ass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_assembly_invoke_load_hook, (MonoAssembly *ass))
 
-MONO_API_FUNCTION(MONO_API MonoAssemblyName*, mono_assembly_name_new, (const char *name))
-MONO_API_FUNCTION(MONO_API const char*, mono_assembly_name_get_name, (MonoAssemblyName *aname))
-MONO_API_FUNCTION(MONO_API const char*, mono_assembly_name_get_culture, (MonoAssemblyName *aname))
-MONO_API_FUNCTION(MONO_API uint16_t, mono_assembly_name_get_version, (MonoAssemblyName *aname, uint16_t *minor, uint16_t *build, uint16_t *revision))
-MONO_API_FUNCTION(MONO_API mono_byte*, mono_assembly_name_get_pubkeytoken, (MonoAssemblyName *aname))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_assembly_name_free, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MonoAssemblyName*, mono_assembly_name_new, (const char *name))
+MONO_API_FUNCTION(const char*, mono_assembly_name_get_name, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(const char*, mono_assembly_name_get_culture, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(uint16_t, mono_assembly_name_get_version, (MonoAssemblyName *aname, uint16_t *minor, uint16_t *build, uint16_t *revision))
+MONO_API_FUNCTION(mono_byte*, mono_assembly_name_get_pubkeytoken, (MonoAssemblyName *aname))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_assembly_name_free, (MonoAssemblyName *aname))
 
-MONO_API_FUNCTION(MONO_API void, mono_register_bundled_assemblies, (const MonoBundledAssembly **assemblies))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_register_config_for_assembly, (const char* assembly_name, const char* config_xml))
-MONO_API_FUNCTION(MONO_API void, mono_register_symfile_for_assembly, (const char* assembly_name, const mono_byte *raw_contents, int size))
-MONO_API_FUNCTION(MONO_API void, mono_register_machine_config, (const char *config_xml))
+MONO_API_FUNCTION(void, mono_register_bundled_assemblies, (const MonoBundledAssembly **assemblies))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_register_config_for_assembly, (const char* assembly_name, const char* config_xml))
+MONO_API_FUNCTION(void, mono_register_symfile_for_assembly, (const char* assembly_name, const mono_byte *raw_contents, int size))
+MONO_API_FUNCTION(void, mono_register_machine_config, (const char *config_xml))
 
-MONO_API_FUNCTION(MONO_API void, mono_set_rootdir, (void))
-MONO_API_FUNCTION(MONO_API void, mono_set_dirs, (const char *assembly_dir, const char *config_dir))
-MONO_API_FUNCTION(MONO_API void, mono_set_assemblies_path, (const char* path))
+MONO_API_FUNCTION(void, mono_set_rootdir, (void))
+MONO_API_FUNCTION(void, mono_set_dirs, (const char *assembly_dir, const char *config_dir))
+MONO_API_FUNCTION(void, mono_set_assemblies_path, (const char* path))
diff --git a/src/native/public/mono/metadata/details/class-functions.h b/src/native/public/mono/metadata/details/class-functions.h
index 086cf9a303c63e..ebef05344a43d3 100644
--- a/src/native/public/mono/metadata/details/class-functions.h
+++ b/src/native/public/mono/metadata/details/class-functions.h
@@ -6,176 +6,176 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get, (MonoImage *image, uint32_t type_token))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get, (MonoImage *image, uint32_t type_token))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get_full, (MonoImage *image, uint32_t type_token, MonoGenericContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_get_full, (MonoImage *image, uint32_t type_token, MonoGenericContext *context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_init, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_init, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoVTable *, mono_class_vtable, (MonoDomain *domain, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoVTable *, mono_class_vtable, (MonoDomain *domain, MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name, (MonoImage *image, const char* name_space, const char *name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name, (MonoImage *image, const char* name_space, const char *name))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name_case, (MonoImage *image, const char* name_space, const char *name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_name_case, (MonoImage *image, const char* name_space, const char *name))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name_flags, (MonoClass *klass, const char *name, int param_count, int flags))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name_flags, (MonoClass *klass, const char *name, int param_count, int flags))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_typeref, (MonoImage *image, uint32_t type_token))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_typeref, (MonoImage *image, uint32_t type_token))
 
-MONO_API_FUNCTION(MONO_API MonoClass *, mono_class_from_typeref_checked, (MonoImage *image, uint32_t type_token, MonoError *error))
+MONO_API_FUNCTION(MonoClass *, mono_class_from_typeref_checked, (MonoImage *image, uint32_t type_token, MonoError *error))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_generic_parameter, (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_generic_parameter, (MonoGenericParam *param, MonoImage *image, mono_bool is_mvar))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_inflate_generic_type, (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */)
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_inflate_generic_type, (MonoType *type, MonoGenericContext *context) /* MONO_DEPRECATED */)
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_class_inflate_generic_method, (MonoMethod *method, MonoGenericContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_class_inflate_generic_method, (MonoMethod *method, MonoGenericContext *context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_inflated_method, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_inflated_method, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_field_from_token, (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_field_from_token, (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_bounded_array_class_get, (MonoClass *element_class, uint32_t rank, mono_bool bounded))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_bounded_array_class_get, (MonoClass *element_class, uint32_t rank, mono_bool bounded))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_array_class_get, (MonoClass *element_class, uint32_t rank))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_array_class_get, (MonoClass *element_class, uint32_t rank))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_ptr_class_get, (MonoType *type))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_ptr_class_get, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API MonoClassField *, mono_class_get_field, (MonoClass *klass, uint32_t field_token))
+MONO_API_FUNCTION(MonoClassField *, mono_class_get_field, (MonoClass *klass, uint32_t field_token))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClassField *, mono_class_get_field_from_name, (MonoClass *klass, const char *name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClassField *, mono_class_get_field_from_name, (MonoClass *klass, const char *name))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_field_token, (MonoClassField *field))
+MONO_API_FUNCTION(uint32_t, mono_class_get_field_token, (MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_event_token, (MonoEvent *event))
+MONO_API_FUNCTION(uint32_t, mono_class_get_event_token, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoProperty *, mono_class_get_property_from_name, (MonoClass *klass, const char *name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoProperty *, mono_class_get_property_from_name, (MonoClass *klass, const char *name))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_property_token, (MonoProperty *prop))
+MONO_API_FUNCTION(uint32_t, mono_class_get_property_token, (MonoProperty *prop))
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_array_element_size, (MonoClass *ac))
+MONO_API_FUNCTION(int32_t, mono_array_element_size, (MonoClass *ac))
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_class_instance_size, (MonoClass *klass))
+MONO_API_FUNCTION(int32_t, mono_class_instance_size, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_class_array_element_size, (MonoClass *klass))
+MONO_API_FUNCTION(int32_t, mono_class_array_element_size, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_class_data_size, (MonoClass *klass))
+MONO_API_FUNCTION(int32_t, mono_class_data_size, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_class_value_size, (MonoClass *klass, uint32_t *align))
+MONO_API_FUNCTION(int32_t, mono_class_value_size, (MonoClass *klass, uint32_t *align))
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_class_min_align, (MonoClass *klass))
+MONO_API_FUNCTION(int32_t, mono_class_min_align, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_mono_type, (MonoType *type))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass *, mono_class_from_mono_type, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_subclass_of, (MonoClass *klass, MonoClass *klassc, mono_bool check_interfaces))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_subclass_of, (MonoClass *klass, MonoClass *klassc, mono_bool check_interfaces))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_assignable_from, (MonoClass *klass, MonoClass *oklass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_assignable_from, (MonoClass *klass, MonoClass *oklass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_ldtoken, (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_ldtoken, (MonoImage *image, uint32_t token, MonoClass **retclass, MonoGenericContext *context))
 
-MONO_API_FUNCTION(MONO_API char *, mono_type_get_name_full, (MonoType *type, MonoTypeNameFormat format))
+MONO_API_FUNCTION(char *, mono_type_get_name_full, (MonoType *type, MonoTypeNameFormat format))
 
-MONO_API_FUNCTION(MONO_API char*, mono_type_get_name, (MonoType *type))
+MONO_API_FUNCTION(char*, mono_type_get_name, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API MonoType*, mono_type_get_underlying_type, (MonoType *type))
+MONO_API_FUNCTION(MonoType*, mono_type_get_underlying_type, (MonoType *type))
 
 /* MonoClass accessors */
-MONO_API_FUNCTION(MONO_API MonoImage*, mono_class_get_image, (MonoClass *klass))
+MONO_API_FUNCTION(MonoImage*, mono_class_get_image, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_element_class, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_element_class, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_valuetype, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_valuetype, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_enum, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_enum, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_enum_basetype, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_enum_basetype, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_parent, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_parent, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_class_get_nesting_type, (MonoClass *klass))
+MONO_API_FUNCTION(MonoClass*, mono_class_get_nesting_type, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int, mono_class_get_rank, (MonoClass *klass))
+MONO_API_FUNCTION(int, mono_class_get_rank, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_flags, (MonoClass *klass))
+MONO_API_FUNCTION(uint32_t, mono_class_get_flags, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_name, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_name, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_namespace, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char*, mono_class_get_namespace, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_get_type, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_class_get_type, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_class_get_type_token, (MonoClass *klass))
+MONO_API_FUNCTION(uint32_t, mono_class_get_type_token, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MonoType*, mono_class_get_byref_type, (MonoClass *klass))
+MONO_API_FUNCTION(MonoType*, mono_class_get_byref_type, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int, mono_class_num_fields, (MonoClass *klass))
+MONO_API_FUNCTION(int, mono_class_num_fields, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int, mono_class_num_methods, (MonoClass *klass))
+MONO_API_FUNCTION(int, mono_class_num_methods, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int, mono_class_num_properties, (MonoClass *klass))
+MONO_API_FUNCTION(int, mono_class_num_properties, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API int, mono_class_num_events, (MonoClass *klass))
+MONO_API_FUNCTION(int, mono_class_num_events, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_class_get_fields, (MonoClass* klass, void **iter))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClassField*, mono_class_get_fields, (MonoClass* klass, void **iter))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_class_get_methods, (MonoClass* klass, void **iter))
+MONO_API_FUNCTION(MonoMethod*, mono_class_get_methods, (MonoClass* klass, void **iter))
 
-MONO_API_FUNCTION(MONO_API MonoProperty*, mono_class_get_properties, (MonoClass* klass, void **iter))
+MONO_API_FUNCTION(MonoProperty*, mono_class_get_properties, (MonoClass* klass, void **iter))
 
-MONO_API_FUNCTION(MONO_API MonoEvent*, mono_class_get_events, (MonoClass* klass, void **iter))
+MONO_API_FUNCTION(MonoEvent*, mono_class_get_events, (MonoClass* klass, void **iter))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_class_get_interfaces, (MonoClass* klass, void **iter))
+MONO_API_FUNCTION(MonoClass*, mono_class_get_interfaces, (MonoClass* klass, void **iter))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_class_get_nested_types, (MonoClass* klass, void **iter))
+MONO_API_FUNCTION(MonoClass*, mono_class_get_nested_types, (MonoClass* klass, void **iter))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_delegate, (MonoClass* klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_is_delegate, (MonoClass* klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_implements_interface, (MonoClass* klass, MonoClass* iface))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_class_implements_interface, (MonoClass* klass, MonoClass* iface))
 
 /* MonoClassField accessors */
-MONO_API_FUNCTION(MONO_API const char*, mono_field_get_name, (MonoClassField *field))
+MONO_API_FUNCTION(const char*, mono_field_get_name, (MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API MonoType*, mono_field_get_type, (MonoClassField *field))
+MONO_API_FUNCTION(MonoType*, mono_field_get_type, (MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_field_get_parent, (MonoClassField *field))
+MONO_API_FUNCTION(MonoClass*, mono_field_get_parent, (MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_field_get_flags, (MonoClassField *field))
+MONO_API_FUNCTION(uint32_t, mono_field_get_flags, (MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_field_get_offset, (MonoClassField *field))
+MONO_API_FUNCTION(uint32_t, mono_field_get_offset, (MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API const char *, mono_field_get_data, (MonoClassField *field))
+MONO_API_FUNCTION(const char *, mono_field_get_data, (MonoClassField *field))
 
 /* MonoProperty acessors */
-MONO_API_FUNCTION(MONO_API const char*, mono_property_get_name, (MonoProperty *prop))
+MONO_API_FUNCTION(const char*, mono_property_get_name, (MonoProperty *prop))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_property_get_set_method, (MonoProperty *prop))
+MONO_API_FUNCTION(MonoMethod*, mono_property_get_set_method, (MonoProperty *prop))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_property_get_get_method, (MonoProperty *prop))
+MONO_API_FUNCTION(MonoMethod*, mono_property_get_get_method, (MonoProperty *prop))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_property_get_parent, (MonoProperty *prop))
+MONO_API_FUNCTION(MonoClass*, mono_property_get_parent, (MonoProperty *prop))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_property_get_flags, (MonoProperty *prop))
+MONO_API_FUNCTION(uint32_t, mono_property_get_flags, (MonoProperty *prop))
 
 /* MonoEvent accessors */
-MONO_API_FUNCTION(MONO_API const char*, mono_event_get_name, (MonoEvent *event))
+MONO_API_FUNCTION(const char*, mono_event_get_name, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_add_method, (MonoEvent *event))
+MONO_API_FUNCTION(MonoMethod*, mono_event_get_add_method, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_remove_method, (MonoEvent *event))
+MONO_API_FUNCTION(MonoMethod*, mono_event_get_remove_method, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_event_get_raise_method, (MonoEvent *event))
+MONO_API_FUNCTION(MonoMethod*, mono_event_get_raise_method, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_event_get_parent, (MonoEvent *event))
+MONO_API_FUNCTION(MonoClass*, mono_event_get_parent, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_event_get_flags, (MonoEvent *event))
+MONO_API_FUNCTION(uint32_t, mono_event_get_flags, (MonoEvent *event))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name, (MonoClass *klass, const char *name, int param_count))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_class_get_method_from_name, (MonoClass *klass, const char *name, int param_count))
 
-MONO_API_FUNCTION(MONO_API char *, mono_class_name_from_token, (MonoImage *image, uint32_t type_token))
+MONO_API_FUNCTION(char *, mono_class_name_from_token, (MonoImage *image, uint32_t type_token))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_method_can_access_field, (MonoMethod *method, MonoClassField *field))
+MONO_API_FUNCTION(mono_bool, mono_method_can_access_field, (MonoMethod *method, MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_method_can_access_method, (MonoMethod *method, MonoMethod *called))
+MONO_API_FUNCTION(mono_bool, mono_method_can_access_method, (MonoMethod *method, MonoMethod *called))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_class_is_nullable, (MonoClass *klass))
+MONO_API_FUNCTION(mono_bool, mono_class_is_nullable, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_nullable_param, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_class_get_nullable_param, (MonoClass *klass))
diff --git a/src/native/public/mono/metadata/details/debug-helpers-functions.h b/src/native/public/mono/metadata/details/debug-helpers-functions.h
index 522de330495f64..de0ca6e9c200d9 100644
--- a/src/native/public/mono/metadata/details/debug-helpers-functions.h
+++ b/src/native/public/mono/metadata/details/debug-helpers-functions.h
@@ -6,27 +6,27 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API char*, mono_disasm_code_one, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte** endp))
-MONO_API_FUNCTION(MONO_API char*, mono_disasm_code, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte* end))
+MONO_API_FUNCTION(char*, mono_disasm_code_one, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte** endp))
+MONO_API_FUNCTION(char*, mono_disasm_code, (MonoDisHelper *dh, MonoMethod *method, const mono_byte *ip, const mono_byte* end))
 
-MONO_API_FUNCTION(MONO_API char*, mono_type_full_name, (MonoType *type))
+MONO_API_FUNCTION(char*, mono_type_full_name, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API char*, mono_signature_get_desc, (MonoMethodSignature *sig, mono_bool include_namespace))
+MONO_API_FUNCTION(char*, mono_signature_get_desc, (MonoMethodSignature *sig, mono_bool include_namespace))
 
-MONO_API_FUNCTION(MONO_API char*, mono_context_get_desc, (MonoGenericContext *context))
+MONO_API_FUNCTION(char*, mono_context_get_desc, (MonoGenericContext *context))
 
-MONO_API_FUNCTION(MONO_API MonoMethodDesc*, mono_method_desc_new, (const char *name, mono_bool include_namespace))
-MONO_API_FUNCTION(MONO_API MonoMethodDesc*, mono_method_desc_from_method, (MonoMethod *method))
-MONO_API_FUNCTION(MONO_API void, mono_method_desc_free, (MonoMethodDesc *desc))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_method_desc_match, (MonoMethodDesc *desc, MonoMethod *method))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_method_desc_is_full, (MonoMethodDesc *desc))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_method_desc_full_match, (MonoMethodDesc *desc, MonoMethod *method))
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_method_desc_search_in_class, (MonoMethodDesc *desc, MonoClass *klass))
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_method_desc_search_in_image, (MonoMethodDesc *desc, MonoImage *image))
+MONO_API_FUNCTION(MonoMethodDesc*, mono_method_desc_new, (const char *name, mono_bool include_namespace))
+MONO_API_FUNCTION(MonoMethodDesc*, mono_method_desc_from_method, (MonoMethod *method))
+MONO_API_FUNCTION(void, mono_method_desc_free, (MonoMethodDesc *desc))
+MONO_API_FUNCTION(mono_bool, mono_method_desc_match, (MonoMethodDesc *desc, MonoMethod *method))
+MONO_API_FUNCTION(mono_bool, mono_method_desc_is_full, (MonoMethodDesc *desc))
+MONO_API_FUNCTION(mono_bool, mono_method_desc_full_match, (MonoMethodDesc *desc, MonoMethod *method))
+MONO_API_FUNCTION(MonoMethod*, mono_method_desc_search_in_class, (MonoMethodDesc *desc, MonoClass *klass))
+MONO_API_FUNCTION(MonoMethod*, mono_method_desc_search_in_image, (MonoMethodDesc *desc, MonoImage *image))
 
-MONO_API_FUNCTION(MONO_API char*, mono_method_full_name, (MonoMethod *method, mono_bool signature))
-MONO_API_FUNCTION(MONO_API char*, mono_method_get_reflection_name, (MonoMethod *method))
+MONO_API_FUNCTION(char*, mono_method_full_name, (MonoMethod *method, mono_bool signature))
+MONO_API_FUNCTION(char*, mono_method_get_reflection_name, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API char*, mono_field_full_name, (MonoClassField *field))
+MONO_API_FUNCTION(char*, mono_field_full_name, (MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_debugger_agent_unhandled_exception, (MonoException *e))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_debugger_agent_unhandled_exception, (MonoException *e))
diff --git a/src/native/public/mono/metadata/details/environment-functions.h b/src/native/public/mono/metadata/details/environment-functions.h
index b4fd7ce7c38e02..afdd61b3e731a6 100644
--- a/src/native/public/mono/metadata/details/environment-functions.h
+++ b/src/native/public/mono/metadata/details/environment-functions.h
@@ -6,6 +6,6 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_environment_exitcode_get, (void))
-MONO_API_FUNCTION(MONO_API void, mono_environment_exitcode_set, (int32_t value))
+MONO_API_FUNCTION(int32_t, mono_environment_exitcode_get, (void))
+MONO_API_FUNCTION(void, mono_environment_exitcode_set, (int32_t value))
 
diff --git a/src/native/public/mono/metadata/details/exception-functions.h b/src/native/public/mono/metadata/details/exception-functions.h
index d78ca33e5b70f9..06447791c65b56 100644
--- a/src/native/public/mono/metadata/details/exception-functions.h
+++ b/src/native/public/mono/metadata/details/exception-functions.h
@@ -6,94 +6,94 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_name, (MonoImage *image, const char* name_space, const char *name))
+MONO_API_FUNCTION(MonoException *, mono_exception_from_name, (MonoImage *image, const char* name_space, const char *name))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_token, (MonoImage *image, uint32_t token))
+MONO_API_FUNCTION(MonoException *, mono_exception_from_token, (MonoImage *image, uint32_t token))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_name_two_strings, (MonoImage *image, const char *name_space, const char *name, MonoString *a1, MonoString *a2))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_name_two_strings, (MonoImage *image, const char *name_space, const char *name, MonoString *a1, MonoString *a2))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_name_msg, (MonoImage *image, const char *name_space, const char *name, const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_exception_from_name_msg, (MonoImage *image, const char *name_space, const char *name, const char *msg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_token_two_strings, (MonoImage *image, uint32_t token, MonoString *a1, MonoString *a2))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_exception_from_token_two_strings, (MonoImage *image, uint32_t token, MonoString *a1, MonoString *a2))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_exception_from_name_domain, (MonoDomain *domain, MonoImage *image, const char* name_space, const char *name))
+MONO_API_FUNCTION(MonoException *, mono_exception_from_name_domain, (MonoDomain *domain, MonoImage *image, const char* name_space, const char *name))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_divide_by_zero, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_divide_by_zero, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_security, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_security, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_arithmetic, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_arithmetic, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_overflow, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_overflow, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_null_reference, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_null_reference, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_execution_engine, (const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_execution_engine, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_thread_abort, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_thread_abort, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_state, (const char *msg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_state, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_interrupted, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_thread_interrupted, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_serialization, (const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_serialization, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_invalid_cast, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_invalid_cast, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_invalid_operation, (const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_invalid_operation, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_index_out_of_range, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_index_out_of_range, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_array_type_mismatch, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_array_type_mismatch, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_type_load, (MonoString *class_name, char *assembly_name))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_type_load, (MonoString *class_name, char *assembly_name))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_method, (const char *class_name, const char *member_name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_method, (const char *class_name, const char *member_name))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_field, (const char *class_name, const char *member_name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_missing_field, (const char *class_name, const char *member_name))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_not_implemented, (const char *msg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_not_implemented, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_not_supported, (const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_not_supported, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException*, mono_get_exception_argument_null, (const char *arg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException*, mono_get_exception_argument_null, (const char *arg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_argument, (const char *arg, const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_argument, (const char *arg, const char *msg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_argument_out_of_range, (const char *arg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_argument_out_of_range, (const char *arg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_io, (const char *msg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_io, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found, (MonoString *fname))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found, (MonoString *fname))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found2, (const char *msg, MonoString *fname))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_file_not_found2, (const char *msg, MonoString *fname))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_type_initialization, (const char *type_name, MonoException *inner))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_type_initialization, (const char *type_name, MonoException *inner))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_synchronization_lock, (const char *msg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_synchronization_lock, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_cannot_unload_appdomain, (const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_cannot_unload_appdomain, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_appdomain_unloaded, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_appdomain_unloaded, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_bad_image_format, (const char *msg))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_bad_image_format, (const char *msg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_bad_image_format2, (const char *msg, MonoString *fname))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_bad_image_format2, (const char *msg, MonoString *fname))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_stack_overflow, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_stack_overflow, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_out_of_memory, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_out_of_memory, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_field_access, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_field_access, (void))
 
-MONO_API_FUNCTION(MONO_API MonoException *, mono_get_exception_method_access, (void))
+MONO_API_FUNCTION(MonoException *, mono_get_exception_method_access, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_reflection_type_load, (MonoArray *types, MonoArray *exceptions))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_reflection_type_load, (MonoArray *types, MonoArray *exceptions))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_runtime_wrapped, (MonoObject *wrapped_exception))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoException *, mono_get_exception_runtime_wrapped, (MonoObject *wrapped_exception))
 
 /* Installs a function which is called when the runtime encounters an unhandled exception.
  * This hook isn't expected to return.
  * If no hook has been installed, the runtime will print a message before aborting.
  */
-MONO_API_FUNCTION(MONO_API void, mono_install_unhandled_exception_hook, (MonoUnhandledExceptionFunc func, void *user_data))
+MONO_API_FUNCTION(void, mono_install_unhandled_exception_hook, (MonoUnhandledExceptionFunc func, void *user_data))
diff --git a/src/native/public/mono/metadata/details/image-functions.h b/src/native/public/mono/metadata/details/image-functions.h
index f7d0c54101f540..6866bf39ec0e2e 100644
--- a/src/native/public/mono/metadata/details/image-functions.h
+++ b/src/native/public/mono/metadata/details/image-functions.h
@@ -6,52 +6,52 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_images_init, (void))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_images_cleanup, (void))
-
-MONO_API_FUNCTION(MONO_API MonoImage *, mono_image_open, (const char *fname, MonoImageOpenStatus *status))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_full, (const char *fname, MonoImageOpenStatus *status, mono_bool refonly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_pe_file_open, (const char *fname, MonoImageOpenStatus *status))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data,  (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_full, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_with_name, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly, const char *name))
-MONO_API_FUNCTION(MONO_API void, mono_image_fixup_vtable, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded, (const char *name))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_full, (const char *name, mono_bool refonly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid, (const char *guid))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid_full, (const char *guid, mono_bool refonly))
-MONO_API_FUNCTION(MONO_API void, mono_image_init, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API void, mono_image_close, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API void, mono_image_addref, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API const char *, mono_image_strerror, (MonoImageOpenStatus status))
-
-MONO_API_FUNCTION(MONO_API int, mono_image_ensure_section, (MonoImage *image, const char *section))
-MONO_API_FUNCTION(MONO_API int, mono_image_ensure_section_idx, (MonoImage *image, int section))
-
-MONO_API_FUNCTION(MONO_API uint32_t, mono_image_get_entry_point, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API const char *, mono_image_get_resource, (MonoImage *image, uint32_t offset, uint32_t *size))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_file_for_image, (MonoImage *image, int fileidx))
-
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_module, (MonoImage *image, int idx))
-
-MONO_API_FUNCTION(MONO_API const char*, mono_image_get_name, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API const char*, mono_image_get_filename, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API const char*, mono_image_get_guid, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API MonoAssembly*, mono_image_get_assembly, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_image_is_dynamic, (MonoImage *image))
-MONO_API_FUNCTION(MONO_API char*, mono_image_rva_map, (MonoImage *image, uint32_t rva))
-
-MONO_API_FUNCTION(MONO_API const MonoTableInfo *, mono_image_get_table_info, (MonoImage *image, int table_id))
-MONO_API_FUNCTION(MONO_API int, mono_image_get_table_rows, (MonoImage *image, int table_id))
-MONO_API_FUNCTION(MONO_API int, mono_table_info_get_rows, (const MonoTableInfo *table))
+MONO_API_FUNCTION(void, mono_images_init, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_images_cleanup, (void))
+
+MONO_API_FUNCTION(MonoImage *, mono_image_open, (const char *fname, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_full, (const char *fname, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_pe_file_open, (const char *fname, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data,  (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_full, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_with_name, (char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, mono_bool refonly, const char *name))
+MONO_API_FUNCTION(void, mono_image_fixup_vtable, (MonoImage *image))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded, (const char *name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_full, (const char *name, mono_bool refonly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid, (const char *guid))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_loaded_by_guid_full, (const char *guid, mono_bool refonly))
+MONO_API_FUNCTION(void, mono_image_init, (MonoImage *image))
+MONO_API_FUNCTION(void, mono_image_close, (MonoImage *image))
+MONO_API_FUNCTION(void, mono_image_addref, (MonoImage *image))
+MONO_API_FUNCTION(const char *, mono_image_strerror, (MonoImageOpenStatus status))
+
+MONO_API_FUNCTION(int, mono_image_ensure_section, (MonoImage *image, const char *section))
+MONO_API_FUNCTION(int, mono_image_ensure_section_idx, (MonoImage *image, int section))
+
+MONO_API_FUNCTION(uint32_t, mono_image_get_entry_point, (MonoImage *image))
+MONO_API_FUNCTION(const char *, mono_image_get_resource, (MonoImage *image, uint32_t offset, uint32_t *size))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_file_for_image, (MonoImage *image, int fileidx))
+
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage*, mono_image_load_module, (MonoImage *image, int idx))
+
+MONO_API_FUNCTION(const char*, mono_image_get_name, (MonoImage *image))
+MONO_API_FUNCTION(const char*, mono_image_get_filename, (MonoImage *image))
+MONO_API_FUNCTION(const char*, mono_image_get_guid, (MonoImage *image))
+MONO_API_FUNCTION(MonoAssembly*, mono_image_get_assembly, (MonoImage *image))
+MONO_API_FUNCTION(mono_bool, mono_image_is_dynamic, (MonoImage *image))
+MONO_API_FUNCTION(char*, mono_image_rva_map, (MonoImage *image, uint32_t rva))
+
+MONO_API_FUNCTION(const MonoTableInfo *, mono_image_get_table_info, (MonoImage *image, int table_id))
+MONO_API_FUNCTION(int, mono_image_get_table_rows, (MonoImage *image, int table_id))
+MONO_API_FUNCTION(int, mono_table_info_get_rows, (const MonoTableInfo *table))
 
 /* This actually returns a MonoPEResourceDataEntry *, but declaring it
  * causes an include file loop.
  */
-MONO_API_FUNCTION(MONO_API void*, mono_image_lookup_resource, (MonoImage *image, uint32_t res_id, uint32_t lang_id, mono_unichar2 *name))
+MONO_API_FUNCTION(void*, mono_image_lookup_resource, (MonoImage *image, uint32_t res_id, uint32_t lang_id, mono_unichar2 *name))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_image_get_public_key, (MonoImage *image, uint32_t *size))
-MONO_API_FUNCTION(MONO_API const char*, mono_image_get_strong_name, (MonoImage *image, uint32_t *size))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_image_strong_name_position, (MonoImage *image, uint32_t *size))
-MONO_API_FUNCTION(MONO_API void, mono_image_add_to_name_cache, (MonoImage *image, const char *nspace, const char *name, uint32_t idx))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_image_has_authenticode_entry, (MonoImage *image))
+MONO_API_FUNCTION(const char*, mono_image_get_public_key, (MonoImage *image, uint32_t *size))
+MONO_API_FUNCTION(const char*, mono_image_get_strong_name, (MonoImage *image, uint32_t *size))
+MONO_API_FUNCTION(uint32_t, mono_image_strong_name_position, (MonoImage *image, uint32_t *size))
+MONO_API_FUNCTION(void, mono_image_add_to_name_cache, (MonoImage *image, const char *nspace, const char *name, uint32_t idx))
+MONO_API_FUNCTION(mono_bool, mono_image_has_authenticode_entry, (MonoImage *image))
diff --git a/src/native/public/mono/metadata/details/loader-functions.h b/src/native/public/mono/metadata/details/loader-functions.h
index 00c2896ba75a55..67bd908adb9114 100644
--- a/src/native/public/mono/metadata/details/loader-functions.h
+++ b/src/native/public/mono/metadata/details/loader-functions.h
@@ -6,59 +6,59 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method, (MonoImage *image, uint32_t token, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method, (MonoImage *image, uint32_t token, MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_full, (MonoImage *image, uint32_t token, MonoClass *klass, MonoGenericContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_full, (MonoImage *image, uint32_t token, MonoClass *klass, MonoGenericContext *context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_constrained, (MonoImage *image, uint32_t token, MonoClass *constrained_class, MonoGenericContext *context, MonoMethod **cil_method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod *, mono_get_method_constrained, (MonoImage *image, uint32_t token, MonoClass *constrained_class, MonoGenericContext *context, MonoMethod **cil_method))
 
-MONO_API_FUNCTION(MONO_API void, mono_free_method, (MonoMethod *method))
+MONO_API_FUNCTION(void, mono_free_method, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature_full, (MonoMethod *method, MonoImage *image, uint32_t token, MonoGenericContext *context))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature_full, (MonoMethod *method, MonoImage *image, uint32_t token, MonoGenericContext *context))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature, (MonoMethod *method, MonoImage *image, uint32_t token))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_get_signature, (MonoMethod *method, MonoImage *image, uint32_t token))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_signature, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_method_signature, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodHeader*, mono_method_get_header, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodHeader*, mono_method_get_header, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_method_get_name, (MonoMethod *method))
+MONO_API_FUNCTION(const char*, mono_method_get_name, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_method_get_class, (MonoMethod *method))
+MONO_API_FUNCTION(MonoClass*, mono_method_get_class, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_token, (MonoMethod *method))
+MONO_API_FUNCTION(uint32_t, mono_method_get_token, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_flags, (MonoMethod *method, uint32_t *iflags))
+MONO_API_FUNCTION(uint32_t, mono_method_get_flags, (MonoMethod *method, uint32_t *iflags))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_index, (MonoMethod *method))
+MONO_API_FUNCTION(uint32_t, mono_method_get_index, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_add_internal_call, (const char *name, const void* method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_add_internal_call, (const char *name, const void* method))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_dangerous_add_raw_internal_call, (const char *name, const void* method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_dangerous_add_raw_internal_call, (const char *name, const void* method))
 
-MONO_API_FUNCTION(MONO_API void*, mono_lookup_internal_call, (MonoMethod *method))
+MONO_API_FUNCTION(void*, mono_lookup_internal_call, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_lookup_icall_symbol, (MonoMethod *m))
+MONO_API_FUNCTION(const char*, mono_lookup_icall_symbol, (MonoMethod *m))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_dllmap_insert, (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_dllmap_insert, (MonoImage *assembly, const char *dll, const char *func, const char *tdll, const char *tfunc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_lookup_pinvoke_call, (MonoMethod *method, const char **exc_class, const char **exc_arg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_lookup_pinvoke_call, (MonoMethod *method, const char **exc_class, const char **exc_arg))
 
-MONO_API_FUNCTION(MONO_API void, mono_method_get_param_names, (MonoMethod *method, const char **names))
+MONO_API_FUNCTION(void, mono_method_get_param_names, (MonoMethod *method, const char **names))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_method_get_param_token, (MonoMethod *method, int idx))
+MONO_API_FUNCTION(uint32_t, mono_method_get_param_token, (MonoMethod *method, int idx))
 
-MONO_API_FUNCTION(MONO_API void, mono_method_get_marshal_info, (MonoMethod *method, MonoMarshalSpec **mspecs))
+MONO_API_FUNCTION(void, mono_method_get_marshal_info, (MonoMethod *method, MonoMarshalSpec **mspecs))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_method_has_marshal_info, (MonoMethod *method))
+MONO_API_FUNCTION(mono_bool, mono_method_has_marshal_info, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MonoMethod*, mono_method_get_last_managed, (void))
+MONO_API_FUNCTION(MonoMethod*, mono_method_get_last_managed, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_stack_walk, (MonoStackWalk func, void* user_data))
+MONO_API_FUNCTION(void, mono_stack_walk, (MonoStackWalk func, void* user_data))
 
 /* Use this if the IL offset is not needed: it's faster */
-MONO_API_FUNCTION(MONO_API void, mono_stack_walk_no_il, (MonoStackWalk func, void* user_data))
+MONO_API_FUNCTION(void, mono_stack_walk_no_il, (MonoStackWalk func, void* user_data))
 
-MONO_API_FUNCTION(MONO_API void, mono_stack_walk_async_safe, (MonoStackWalkAsyncSafe func, void *initial_sig_context, void* user_data))
+MONO_API_FUNCTION(void, mono_stack_walk_async_safe, (MonoStackWalkAsyncSafe func, void *initial_sig_context, void* user_data))
 
-MONO_API_FUNCTION(MONO_API MonoMethodHeader*, mono_method_get_header_checked, (MonoMethod *method, MonoError *error))
+MONO_API_FUNCTION(MonoMethodHeader*, mono_method_get_header_checked, (MonoMethod *method, MonoError *error))
diff --git a/src/native/public/mono/metadata/details/metadata-functions.h b/src/native/public/mono/metadata/details/metadata-functions.h
index 77a4234eaf4f54..3b665f2a3b488e 100644
--- a/src/native/public/mono/metadata/details/metadata-functions.h
+++ b/src/native/public/mono/metadata/details/metadata-functions.h
@@ -7,153 +7,153 @@
 #endif
 
 
-MONO_API_FUNCTION(MONO_API void, mono_metadata_init, (void))
+MONO_API_FUNCTION(void, mono_metadata_init, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_metadata_decode_row, (const MonoTableInfo *t, int idx, uint32_t *res, int res_size))
+MONO_API_FUNCTION(void, mono_metadata_decode_row, (const MonoTableInfo *t, int idx, uint32_t *res, int res_size))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_row_col, (const MonoTableInfo *t, int idx, unsigned int col))
+MONO_API_FUNCTION(uint32_t, mono_metadata_decode_row_col, (const MonoTableInfo *t, int idx, unsigned int col))
 
-MONO_API_FUNCTION(MONO_API int, mono_metadata_compute_size, (MonoImage *meta, int tableindex, uint32_t *result_bitfield))
+MONO_API_FUNCTION(int, mono_metadata_compute_size, (MonoImage *meta, int tableindex, uint32_t *result_bitfield))
 
 /*
  *
  */
-MONO_API_FUNCTION(MONO_API const char *, mono_metadata_locate, (MonoImage *meta, int table, int idx))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY const char *, mono_metadata_locate_token, (MonoImage *meta, uint32_t token))
+MONO_API_FUNCTION(const char *, mono_metadata_locate, (MonoImage *meta, int table, int idx))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY const char *, mono_metadata_locate_token, (MonoImage *meta, uint32_t token))
 
-MONO_API_FUNCTION(MONO_API const char *, mono_metadata_string_heap, (MonoImage *meta, uint32_t table_index))
-MONO_API_FUNCTION(MONO_API const char *, mono_metadata_blob_heap, (MonoImage *meta, uint32_t table_index))
-MONO_API_FUNCTION(MONO_API const char *, mono_metadata_user_string, (MonoImage *meta, uint32_t table_index))
-MONO_API_FUNCTION(MONO_API const char *, mono_metadata_guid_heap, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(const char *, mono_metadata_string_heap, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(const char *, mono_metadata_blob_heap, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(const char *, mono_metadata_user_string, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(const char *, mono_metadata_guid_heap, (MonoImage *meta, uint32_t table_index))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_typedef_from_field, (MonoImage *meta, uint32_t table_index))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_typedef_from_method, (MonoImage *meta, uint32_t table_index))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_nested_in_typedef, (MonoImage *meta, uint32_t table_index))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_nesting_typedef, (MonoImage *meta, uint32_t table_index, uint32_t start_index))
+MONO_API_FUNCTION(uint32_t, mono_metadata_typedef_from_field, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(uint32_t, mono_metadata_typedef_from_method, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(uint32_t, mono_metadata_nested_in_typedef, (MonoImage *meta, uint32_t table_index))
+MONO_API_FUNCTION(uint32_t, mono_metadata_nesting_typedef, (MonoImage *meta, uint32_t table_index, uint32_t start_index))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass**, mono_metadata_interfaces_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *count))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass**, mono_metadata_interfaces_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *count))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_events_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end_idx))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_methods_from_event, (MonoImage *meta, uint32_t table_index, unsigned int *end))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_properties_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_methods_from_property, (MonoImage *meta, uint32_t table_index, unsigned int *end))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_packing_from_typedef, (MonoImage *meta, uint32_t table_index, uint32_t *packing, uint32_t *size))
-MONO_API_FUNCTION(MONO_API const char*, mono_metadata_get_marshal_info, (MonoImage *meta, uint32_t idx, mono_bool is_field))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_custom_attrs_from_index, (MonoImage *meta, uint32_t cattr_index))
+MONO_API_FUNCTION(uint32_t, mono_metadata_events_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end_idx))
+MONO_API_FUNCTION(uint32_t, mono_metadata_methods_from_event, (MonoImage *meta, uint32_t table_index, unsigned int *end))
+MONO_API_FUNCTION(uint32_t, mono_metadata_properties_from_typedef, (MonoImage *meta, uint32_t table_index, unsigned int *end))
+MONO_API_FUNCTION(uint32_t, mono_metadata_methods_from_property, (MonoImage *meta, uint32_t table_index, unsigned int *end))
+MONO_API_FUNCTION(uint32_t, mono_metadata_packing_from_typedef, (MonoImage *meta, uint32_t table_index, uint32_t *packing, uint32_t *size))
+MONO_API_FUNCTION(const char*, mono_metadata_get_marshal_info, (MonoImage *meta, uint32_t idx, mono_bool is_field))
+MONO_API_FUNCTION(uint32_t, mono_metadata_custom_attrs_from_index, (MonoImage *meta, uint32_t cattr_index))
 
-MONO_API_FUNCTION(MONO_API MonoMarshalSpec *, mono_metadata_parse_marshal_spec, (MonoImage *image, const char *ptr))
+MONO_API_FUNCTION(MonoMarshalSpec *, mono_metadata_parse_marshal_spec, (MonoImage *image, const char *ptr))
 
-MONO_API_FUNCTION(MONO_API void, mono_metadata_free_marshal_spec, (MonoMarshalSpec *spec))
+MONO_API_FUNCTION(void, mono_metadata_free_marshal_spec, (MonoMarshalSpec *spec))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_implmap_from_method, (MonoImage *meta, uint32_t method_idx))
+MONO_API_FUNCTION(uint32_t, mono_metadata_implmap_from_method, (MonoImage *meta, uint32_t method_idx))
 
-MONO_API_FUNCTION(MONO_API void, mono_metadata_field_info, (MonoImage *meta, uint32_t table_index, uint32_t *offset, uint32_t *rva, MonoMarshalSpec **marshal_spec))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_get_constant_index, (MonoImage *meta, uint32_t token, uint32_t hint))
+MONO_API_FUNCTION(void, mono_metadata_field_info, (MonoImage *meta, uint32_t table_index, uint32_t *offset, uint32_t *rva, MonoMarshalSpec **marshal_spec))
+MONO_API_FUNCTION(uint32_t, mono_metadata_get_constant_index, (MonoImage *meta, uint32_t token, uint32_t hint))
 
 /*
  * Functions to extract information from the Blobs
  */
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_value, (const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API int32_t, mono_metadata_decode_signed_value, (const char *ptr, const char **rptr))
+MONO_API_FUNCTION(uint32_t, mono_metadata_decode_value, (const char *ptr, const char **rptr))
+MONO_API_FUNCTION(int32_t, mono_metadata_decode_signed_value, (const char *ptr, const char **rptr))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_blob_size, (const char *ptr, const char **rptr))
+MONO_API_FUNCTION(uint32_t, mono_metadata_decode_blob_size, (const char *ptr, const char **rptr))
 
-MONO_API_FUNCTION(MONO_API void, mono_metadata_encode_value, (uint32_t value, char *bug, char **endbuf))
+MONO_API_FUNCTION(void, mono_metadata_encode_value, (uint32_t value, char *bug, char **endbuf))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_type_is_byref, (MonoType *type))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_type_is_byref, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_type_get_type, (MonoType *type))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_type_get_type, (MonoType *type))
 
 /* For MONO_TYPE_FNPTR */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_type_get_signature, (MonoType *type))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature*, mono_type_get_signature, (MonoType *type))
 
 /* For MONO_TYPE_CLASS, VALUETYPE */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_type_get_class, (MonoType *type))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_type_get_class, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API MonoArrayType*, mono_type_get_array_type, (MonoType *type))
+MONO_API_FUNCTION(MonoArrayType*, mono_type_get_array_type, (MonoType *type))
 
 /* For MONO_TYPE_PTR */
-MONO_API_FUNCTION(MONO_API MonoType*, mono_type_get_ptr_type, (MonoType *type))
+MONO_API_FUNCTION(MonoType*, mono_type_get_ptr_type, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API MonoClass*, mono_type_get_modifiers, (MonoType *type, mono_bool *is_required, void **iter))
+MONO_API_FUNCTION(MonoClass*, mono_type_get_modifiers, (MonoType *type, mono_bool *is_required, void **iter))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_struct, (MonoType *type))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_void, (MonoType *type))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_pointer, (MonoType *type))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_reference, (MonoType *type))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_type_is_generic_parameter, (MonoType *type))
+MONO_API_FUNCTION(mono_bool, mono_type_is_struct, (MonoType *type))
+MONO_API_FUNCTION(mono_bool, mono_type_is_void, (MonoType *type))
+MONO_API_FUNCTION(mono_bool, mono_type_is_pointer, (MonoType *type))
+MONO_API_FUNCTION(mono_bool, mono_type_is_reference, (MonoType *type))
+MONO_API_FUNCTION(mono_bool, mono_type_is_generic_parameter, (MonoType *type))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_return_type, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_return_type, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_params, (MonoMethodSignature *sig, void **iter))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_signature_get_params, (MonoMethodSignature *sig, void **iter))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_signature_get_param_count, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(uint32_t, mono_signature_get_param_count, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_signature_get_call_conv, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(uint32_t, mono_signature_get_call_conv, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API int, mono_signature_vararg_start, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(int, mono_signature_vararg_start, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_signature_is_instance, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(mono_bool, mono_signature_is_instance, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_signature_explicit_this, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(mono_bool, mono_signature_explicit_this, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_signature_param_is_out, (MonoMethodSignature *sig, int param_num))
+MONO_API_FUNCTION(mono_bool, mono_signature_param_is_out, (MonoMethodSignature *sig, int param_num))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_parse_typedef_or_ref, (MonoImage *m, const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API int, mono_metadata_parse_custom_mod, (MonoImage *m, MonoCustomMod *dest, const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArrayType *, mono_metadata_parse_array, (MonoImage *m, const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API void, mono_metadata_free_array, (MonoArrayType     *array))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_type, (MonoImage *m, MonoParseTypeMode mode, short opt_attrs, const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_param, (MonoImage *m, const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_field_type, (MonoImage *m, short field_flags, const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType *, mono_type_create_from_typespec, (MonoImage *image, uint32_t type_spec))
-MONO_API_FUNCTION(MONO_API void, mono_metadata_free_type, (MonoType *type))
-MONO_API_FUNCTION(MONO_API int, mono_type_size, (MonoType *type, int *alignment))
-MONO_API_FUNCTION(MONO_API int, mono_type_stack_size, (MonoType *type, int *alignment))
+MONO_API_FUNCTION(uint32_t, mono_metadata_parse_typedef_or_ref, (MonoImage *m, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(int, mono_metadata_parse_custom_mod, (MonoImage *m, MonoCustomMod *dest, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArrayType *, mono_metadata_parse_array, (MonoImage *m, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(void, mono_metadata_free_array, (MonoArrayType     *array))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_type, (MonoImage *m, MonoParseTypeMode mode, short opt_attrs, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_param, (MonoImage *m, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_metadata_parse_field_type, (MonoImage *m, short field_flags, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType *, mono_type_create_from_typespec, (MonoImage *image, uint32_t type_spec))
+MONO_API_FUNCTION(void, mono_metadata_free_type, (MonoType *type))
+MONO_API_FUNCTION(int, mono_type_size, (MonoType *type, int *alignment))
+MONO_API_FUNCTION(int, mono_type_stack_size, (MonoType *type, int *alignment))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_type_generic_inst_is_valuetype, (MonoType *type))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_metadata_generic_class_is_valuetype, (MonoGenericClass *gclass))
+MONO_API_FUNCTION(mono_bool, mono_type_generic_inst_is_valuetype, (MonoType *type))
+MONO_API_FUNCTION(mono_bool, mono_metadata_generic_class_is_valuetype, (MonoGenericClass *gclass))
 
-MONO_API_FUNCTION(MONO_API unsigned int, mono_metadata_type_hash, (MonoType *t1))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_metadata_type_equal, (MonoType *t1, MonoType *t2))
+MONO_API_FUNCTION(unsigned int, mono_metadata_type_hash, (MonoType *t1))
+MONO_API_FUNCTION(mono_bool, mono_metadata_type_equal, (MonoType *t1, MonoType *t2))
 
-MONO_API_FUNCTION(MONO_API MonoMethodSignature *, mono_metadata_signature_alloc, (MonoImage *image, uint32_t nparams))
+MONO_API_FUNCTION(MonoMethodSignature *, mono_metadata_signature_alloc, (MonoImage *image, uint32_t nparams))
 
-MONO_API_FUNCTION(MONO_API MonoMethodSignature *, mono_metadata_signature_dup, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(MonoMethodSignature *, mono_metadata_signature_dup, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_signature, (MonoImage *image, uint32_t token))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_signature, (MonoImage *image, uint32_t token))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_method_signature, (MonoImage *m, int def, const char *ptr, const char **rptr))
-MONO_API_FUNCTION(MONO_API void, mono_metadata_free_method_signature, (MonoMethodSignature *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodSignature *, mono_metadata_parse_method_signature, (MonoImage *m, int def, const char *ptr, const char **rptr))
+MONO_API_FUNCTION(void, mono_metadata_free_method_signature, (MonoMethodSignature *method))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_metadata_signature_equal, (MonoMethodSignature *sig1, MonoMethodSignature *sig2))
+MONO_API_FUNCTION(mono_bool, mono_metadata_signature_equal, (MonoMethodSignature *sig1, MonoMethodSignature *sig2))
 
-MONO_API_FUNCTION(MONO_API unsigned int, mono_signature_hash, (MonoMethodSignature *sig))
+MONO_API_FUNCTION(unsigned int, mono_signature_hash, (MonoMethodSignature *sig))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodHeader *, mono_metadata_parse_mh, (MonoImage *m, const char *ptr))
-MONO_API_FUNCTION(MONO_API void, mono_metadata_free_mh, (MonoMethodHeader *mh))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethodHeader *, mono_metadata_parse_mh, (MonoImage *m, const char *ptr))
+MONO_API_FUNCTION(void, mono_metadata_free_mh, (MonoMethodHeader *mh))
 
 /* MonoMethodHeader accessors */
-MONO_API_FUNCTION(MONO_API const unsigned char*, mono_method_header_get_code, (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack))
+MONO_API_FUNCTION(const unsigned char*, mono_method_header_get_code, (MonoMethodHeader *header, uint32_t* code_size, uint32_t* max_stack))
 
-MONO_API_FUNCTION(MONO_API MonoType**, mono_method_header_get_locals, (MonoMethodHeader *header, uint32_t* num_locals, mono_bool *init_locals))
+MONO_API_FUNCTION(MonoType**, mono_method_header_get_locals, (MonoMethodHeader *header, uint32_t* num_locals, mono_bool *init_locals))
 
-MONO_API_FUNCTION(MONO_API int, mono_method_header_get_num_clauses, (MonoMethodHeader *header))
+MONO_API_FUNCTION(int, mono_method_header_get_num_clauses, (MonoMethodHeader *header))
 
-MONO_API_FUNCTION(MONO_API int, mono_method_header_get_clauses, (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause))
+MONO_API_FUNCTION(int, mono_method_header_get_clauses, (MonoMethodHeader *header, MonoMethod *method, void **iter, MonoExceptionClause *clause))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_type_to_unmanaged, (MonoType *type, MonoMarshalSpec *mspec, mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv))
+MONO_API_FUNCTION(uint32_t, mono_type_to_unmanaged, (MonoType *type, MonoMarshalSpec *mspec, mono_bool as_field, mono_bool unicode, MonoMarshalConv *conv))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_token_from_dor, (uint32_t dor_index))
+MONO_API_FUNCTION(uint32_t, mono_metadata_token_from_dor, (uint32_t dor_index))
 
-MONO_API_FUNCTION(MONO_API char *, mono_guid_to_string, (const uint8_t *guid))
+MONO_API_FUNCTION(char *, mono_guid_to_string, (const uint8_t *guid))
 
-MONO_API_FUNCTION(MONO_API char *, mono_guid_to_string_minimal, (const uint8_t *guid))
+MONO_API_FUNCTION(char *, mono_guid_to_string_minimal, (const uint8_t *guid))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_declsec_from_index, (MonoImage *meta, uint32_t idx))
+MONO_API_FUNCTION(uint32_t, mono_metadata_declsec_from_index, (MonoImage *meta, uint32_t idx))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_translate_token_index, (MonoImage *image, int table, uint32_t idx))
+MONO_API_FUNCTION(uint32_t, mono_metadata_translate_token_index, (MonoImage *image, int table, uint32_t idx))
 
-MONO_API_FUNCTION(MONO_API void, mono_metadata_decode_table_row, (MonoImage *image, int table, int idx, uint32_t *res, int res_size))
+MONO_API_FUNCTION(void, mono_metadata_decode_table_row, (MonoImage *image, int table, int idx, uint32_t *res, int res_size))
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_metadata_decode_table_row_col, (MonoImage *image, int table, int idx, unsigned int col))
+MONO_API_FUNCTION(uint32_t, mono_metadata_decode_table_row_col, (MonoImage *image, int table, int idx, unsigned int col))
diff --git a/src/native/public/mono/metadata/details/mono-config-functions.h b/src/native/public/mono/metadata/details/mono-config-functions.h
index fbb445fde66d8e..a297eb108a6cad 100644
--- a/src/native/public/mono/metadata/details/mono-config-functions.h
+++ b/src/native/public/mono/metadata/details/mono-config-functions.h
@@ -6,21 +6,21 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API const char *, mono_config_get_os, (void))
-MONO_API_FUNCTION(MONO_API const char *, mono_config_get_cpu, (void))
-MONO_API_FUNCTION(MONO_API const char *, mono_config_get_wordsize, (void))
+MONO_API_FUNCTION(const char *, mono_config_get_os, (void))
+MONO_API_FUNCTION(const char *, mono_config_get_cpu, (void))
+MONO_API_FUNCTION(const char *, mono_config_get_wordsize, (void))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_get_config_dir, (void))
-MONO_API_FUNCTION(MONO_API void, mono_set_config_dir, (const char *dir))
+MONO_API_FUNCTION(const char*, mono_get_config_dir, (void))
+MONO_API_FUNCTION(void, mono_set_config_dir, (const char *dir))
 
-MONO_API_FUNCTION(MONO_API const char *, mono_get_machine_config, (void))
+MONO_API_FUNCTION(const char *, mono_get_machine_config, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_config_cleanup, (void))
-MONO_API_FUNCTION(MONO_API void, mono_config_parse, (const char *filename))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_config_for_assembly, (MonoImage *assembly))
-MONO_API_FUNCTION(MONO_API void, mono_config_parse_memory, (const char *buffer))
+MONO_API_FUNCTION(void, mono_config_cleanup, (void))
+MONO_API_FUNCTION(void, mono_config_parse, (const char *filename))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_config_for_assembly, (MonoImage *assembly))
+MONO_API_FUNCTION(void, mono_config_parse_memory, (const char *buffer))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_config_string_for_assembly_file, (const char *filename))
+MONO_API_FUNCTION(const char*, mono_config_string_for_assembly_file, (const char *filename))
 
-MONO_API_FUNCTION(MONO_API void, mono_config_set_server_mode, (mono_bool server_mode))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_config_is_server_mode, (void))
+MONO_API_FUNCTION(void, mono_config_set_server_mode, (mono_bool server_mode))
+MONO_API_FUNCTION(mono_bool, mono_config_is_server_mode, (void))
diff --git a/src/native/public/mono/metadata/details/mono-debug-functions.h b/src/native/public/mono/metadata/details/mono-debug-functions.h
index a77443b88bab6a..1ef12f767465c1 100644
--- a/src/native/public/mono/metadata/details/mono-debug-functions.h
+++ b/src/native/public/mono/metadata/details/mono-debug-functions.h
@@ -6,51 +6,51 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_debug_enabled, (void))
+MONO_API_FUNCTION(mono_bool, mono_debug_enabled, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_debug_init, (MonoDebugFormat format))
-MONO_API_FUNCTION(MONO_API void, mono_debug_open_image_from_memory, (MonoImage *image, const mono_byte *raw_contents, int size))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_debug_cleanup, (void))
+MONO_API_FUNCTION(void, mono_debug_init, (MonoDebugFormat format))
+MONO_API_FUNCTION(void, mono_debug_open_image_from_memory, (MonoImage *image, const mono_byte *raw_contents, int size))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_debug_cleanup, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_debug_close_image, (MonoImage *image))
+MONO_API_FUNCTION(void, mono_debug_close_image, (MonoImage *image))
 
-MONO_API_FUNCTION(MONO_API void, mono_debug_domain_unload, (MonoDomain *domain))
-MONO_API_FUNCTION(MONO_API void, mono_debug_domain_create, (MonoDomain *domain))
+MONO_API_FUNCTION(void, mono_debug_domain_unload, (MonoDomain *domain))
+MONO_API_FUNCTION(void, mono_debug_domain_create, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MonoDebugMethodAddress *, mono_debug_add_method, (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain))
+MONO_API_FUNCTION(MonoDebugMethodAddress *, mono_debug_add_method, (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API void, mono_debug_remove_method, (MonoMethod *method, MonoDomain *domain))
+MONO_API_FUNCTION(void, mono_debug_remove_method, (MonoMethod *method, MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MonoDebugMethodInfo *, mono_debug_lookup_method, (MonoMethod *method))
+MONO_API_FUNCTION(MonoDebugMethodInfo *, mono_debug_lookup_method, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MonoDebugMethodAddressList *, mono_debug_lookup_method_addresses, (MonoMethod *method))
+MONO_API_FUNCTION(MonoDebugMethodAddressList *, mono_debug_lookup_method_addresses, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MonoDebugMethodJitInfo*, mono_debug_find_method, (MonoMethod *method, MonoDomain *domain))
+MONO_API_FUNCTION(MonoDebugMethodJitInfo*, mono_debug_find_method, (MonoMethod *method, MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MonoDebugHandle *, mono_debug_get_handle, (MonoImage *image))
+MONO_API_FUNCTION(MonoDebugHandle *, mono_debug_get_handle, (MonoImage *image))
 
-MONO_API_FUNCTION(MONO_API void, mono_debug_free_method_jit_info, (MonoDebugMethodJitInfo *jit))
+MONO_API_FUNCTION(void, mono_debug_free_method_jit_info, (MonoDebugMethodJitInfo *jit))
 
 
-MONO_API_FUNCTION(MONO_API void, mono_debug_add_delegate_trampoline, (void* code, int size))
+MONO_API_FUNCTION(void, mono_debug_add_delegate_trampoline, (void* code, int size))
 
-MONO_API_FUNCTION(MONO_API MonoDebugLocalsInfo*, mono_debug_lookup_locals, (MonoMethod *method))
+MONO_API_FUNCTION(MonoDebugLocalsInfo*, mono_debug_lookup_locals, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MonoDebugMethodAsyncInfo*, mono_debug_lookup_method_async_debug_info, (MonoMethod *method))
+MONO_API_FUNCTION(MonoDebugMethodAsyncInfo*, mono_debug_lookup_method_async_debug_info, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MonoDebugSourceLocation *, mono_debug_method_lookup_location, (MonoDebugMethodInfo *minfo, int il_offset))
+MONO_API_FUNCTION(MonoDebugSourceLocation *, mono_debug_method_lookup_location, (MonoDebugMethodInfo *minfo, int il_offset))
 
 /*
  * Line number support.
  */
 
-MONO_API_FUNCTION(MONO_API MonoDebugSourceLocation *, mono_debug_lookup_source_location, (MonoMethod *method, uint32_t address, MonoDomain *domain))
+MONO_API_FUNCTION(MonoDebugSourceLocation *, mono_debug_lookup_source_location, (MonoMethod *method, uint32_t address, MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API int32_t, mono_debug_il_offset_from_address, (MonoMethod *method, MonoDomain *domain, uint32_t native_offset))
+MONO_API_FUNCTION(int32_t, mono_debug_il_offset_from_address, (MonoMethod *method, MonoDomain *domain, uint32_t native_offset))
 
-MONO_API_FUNCTION(MONO_API void, mono_debug_free_source_location, (MonoDebugSourceLocation *location))
+MONO_API_FUNCTION(void, mono_debug_free_source_location, (MonoDebugSourceLocation *location))
 
-MONO_API_FUNCTION(MONO_API char *, mono_debug_print_stack_frame, (MonoMethod *method, uint32_t native_offset, MonoDomain *domain))
+MONO_API_FUNCTION(char *, mono_debug_print_stack_frame, (MonoMethod *method, uint32_t native_offset, MonoDomain *domain))
 
 /*
  * Mono Debugger support functions
@@ -58,8 +58,8 @@ MONO_API_FUNCTION(MONO_API char *, mono_debug_print_stack_frame, (MonoMethod *me
  * These methods are used by the JIT while running inside the Mono Debugger.
  */
 
-MONO_API_FUNCTION(MONO_API int, mono_debugger_method_has_breakpoint, (MonoMethod *method))
-MONO_API_FUNCTION(MONO_API int, mono_debugger_insert_breakpoint, (const char *method_name, mono_bool include_namespace))
+MONO_API_FUNCTION(int, mono_debugger_method_has_breakpoint, (MonoMethod *method))
+MONO_API_FUNCTION(int, mono_debugger_insert_breakpoint, (const char *method_name, mono_bool include_namespace))
 
-MONO_API_FUNCTION(MONO_API void, mono_set_is_debugger_attached, (mono_bool attached))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_is_debugger_attached, (void))
+MONO_API_FUNCTION(void, mono_set_is_debugger_attached, (mono_bool attached))
+MONO_API_FUNCTION(mono_bool, mono_is_debugger_attached, (void))
diff --git a/src/native/public/mono/metadata/details/mono-gc-functions.h b/src/native/public/mono/metadata/details/mono-gc-functions.h
index 3204b756b85db8..6208110d1c789c 100644
--- a/src/native/public/mono/metadata/details/mono-gc-functions.h
+++ b/src/native/public/mono/metadata/details/mono-gc-functions.h
@@ -6,17 +6,17 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_gc_collect, (int generation))
-MONO_API_FUNCTION(MONO_API int, mono_gc_max_generation, (void))
-MONO_API_FUNCTION(MONO_API int, mono_gc_get_generation, (MonoObject *object))
-MONO_API_FUNCTION(MONO_API int, mono_gc_collection_count, (int generation))
-MONO_API_FUNCTION(MONO_API int64_t, mono_gc_get_generation_size, (int generation))
-MONO_API_FUNCTION(MONO_API int64_t, mono_gc_get_used_size, (void))
-MONO_API_FUNCTION(MONO_API int64_t, mono_gc_get_heap_size, (void))
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_gc_pending_finalizers, (void))
-MONO_API_FUNCTION(MONO_API void, mono_gc_finalize_notify, (void))
-MONO_API_FUNCTION(MONO_API int, mono_gc_invoke_finalizers, (void))
+MONO_API_FUNCTION(void, mono_gc_collect, (int generation))
+MONO_API_FUNCTION(int, mono_gc_max_generation, (void))
+MONO_API_FUNCTION(int, mono_gc_get_generation, (MonoObject *object))
+MONO_API_FUNCTION(int, mono_gc_collection_count, (int generation))
+MONO_API_FUNCTION(int64_t, mono_gc_get_generation_size, (int generation))
+MONO_API_FUNCTION(int64_t, mono_gc_get_used_size, (void))
+MONO_API_FUNCTION(int64_t, mono_gc_get_heap_size, (void))
+MONO_API_FUNCTION(MonoBoolean, mono_gc_pending_finalizers, (void))
+MONO_API_FUNCTION(void, mono_gc_finalize_notify, (void))
+MONO_API_FUNCTION(int, mono_gc_invoke_finalizers, (void))
 /* heap walking is only valid in the pre-stop-world event callback */
-MONO_API_FUNCTION(MONO_API int, mono_gc_walk_heap, (int flags, MonoGCReferences callback, void *data))
+MONO_API_FUNCTION(int, mono_gc_walk_heap, (int flags, MonoGCReferences callback, void *data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_init_finalizer_thread, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_init_finalizer_thread, (void))
diff --git a/src/native/public/mono/metadata/details/mono-private-unstable-functions.h b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
index 2b6cc9107747e9..e515072680d1e1 100644
--- a/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
+++ b/src/native/public/mono/metadata/details/mono-private-unstable-functions.h
@@ -14,15 +14,15 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_load_full_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssembly *, mono_assembly_load_full_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, MonoAssemblyName *aname, const char *basedir, MonoImageOpenStatus *status))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, const char *name))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoImage *, mono_image_open_from_data_alc, (MonoAssemblyLoadContextGCHandle alc_gchandle, char *data, uint32_t data_len, mono_bool need_copy, MonoImageOpenStatus *status, const char *name))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook_v3, (MonoAssemblyPreLoadFuncV3 func, void *user_data, mono_bool append))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_install_assembly_preload_hook_v3, (MonoAssemblyPreLoadFuncV3 func, void *user_data, mono_bool append))
 
 // This can point at NULL before the default ALC is initialized
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoAssemblyLoadContextGCHandle, mono_alc_get_default_gchandle, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoAssemblyLoadContextGCHandle, mono_alc_get_default_gchandle, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_register_bundled_satellite_assemblies, (const MonoBundledSatelliteAssembly **assemblies))
+MONO_API_FUNCTION(void, mono_register_bundled_satellite_assemblies, (const MonoBundledSatelliteAssembly **assemblies))
 
-MONO_API_FUNCTION(MONO_API MonoBundledSatelliteAssembly *, mono_create_new_bundled_satellite_assembly, (const char *name, const char *culture, const unsigned char *data, unsigned int size))
+MONO_API_FUNCTION(MonoBundledSatelliteAssembly *, mono_create_new_bundled_satellite_assembly, (const char *name, const char *culture, const unsigned char *data, unsigned int size))
diff --git a/src/native/public/mono/metadata/details/object-functions.h b/src/native/public/mono/metadata/details/object-functions.h
index 9cf277e9b2a54a..18b80f3e4cddd5 100644
--- a/src/native/public/mono/metadata/details/object-functions.h
+++ b/src/native/public/mono/metadata/details/object-functions.h
@@ -6,174 +6,174 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_chars, (MonoString *s))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_string_length, (MonoString *s))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_chars, (MonoString *s))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_string_length, (MonoString *s))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new, (MonoDomain *domain, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new, (MonoDomain *domain, MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_specific, (MonoVTable *vtable))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_specific, (MonoVTable *vtable))
 
 /* can be used for classes without finalizer in non-profiling mode */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_fast, (MonoVTable *vtable))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_fast, (MonoVTable *vtable))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_alloc_specific, (MonoVTable *vtable))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_alloc_specific, (MonoVTable *vtable))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_from_token, (MonoDomain *domain, MonoImage *image, uint32_t token))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_new_from_token, (MonoDomain *domain, MonoImage *image, uint32_t token))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new, (MonoDomain *domain, MonoClass *eclass, uintptr_t n))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new, (MonoDomain *domain, MonoClass *eclass, uintptr_t n))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new_full, (MonoDomain *domain, MonoClass *array_class, uintptr_t *lengths, intptr_t *lower_bounds))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_new_full, (MonoDomain *domain, MonoClass *array_class, uintptr_t *lengths, intptr_t *lower_bounds))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray *, mono_array_new_specific, (MonoVTable *vtable, uintptr_t n))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray *, mono_array_new_specific, (MonoVTable *vtable, uintptr_t n))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_clone, (MonoArray *array))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_array_clone, (MonoArray *array))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY char*, mono_array_addr_with_size, (MonoArray *array, int size, uintptr_t idx))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY char*, mono_array_addr_with_size, (MonoArray *array, int size, uintptr_t idx))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uintptr_t, mono_array_length, (MonoArray *array))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uintptr_t, mono_array_length, (MonoArray *array))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty_wrapper, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_empty_wrapper, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf16, (MonoDomain *domain, const mono_unichar2 *text, int32_t len))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf16, (MonoDomain *domain, const mono_unichar2 *text, int32_t len))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_size, (MonoDomain *domain, int32_t len))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_size, (MonoDomain *domain, int32_t len))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_ldstr, (MonoDomain *domain, MonoImage *image, uint32_t str_index))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_ldstr, (MonoDomain *domain, MonoImage *image, uint32_t str_index))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_is_interned, (MonoString *str))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_is_interned, (MonoString *str))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_intern, (MonoString *str))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_intern, (MonoString *str))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new, (MonoDomain *domain, const char *text))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new, (MonoDomain *domain, const char *text))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_wrapper, (const char *text))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_wrapper, (const char *text))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_len, (MonoDomain *domain, const char *text, unsigned int length))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_len, (MonoDomain *domain, const char *text, unsigned int length))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf32, (MonoDomain *domain, const mono_unichar4 *text, int32_t len))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString*, mono_string_new_utf32, (MonoDomain *domain, const mono_unichar4 *text, int32_t len))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8, (MonoString *string_obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8, (MonoString *string_obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8_checked, (MonoString *string_obj, MonoError *error))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY char *, mono_string_to_utf8_checked, (MonoString *string_obj, MonoError *error))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_to_utf16, (MonoString *string_obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_unichar2 *, mono_string_to_utf16, (MonoString *string_obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_unichar4 *, mono_string_to_utf32, (MonoString *string_obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_unichar4 *, mono_string_to_utf32, (MonoString *string_obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf16, (/*const*/ mono_unichar2 *data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf16, (/*const*/ mono_unichar2 *data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf32, (/*const*/ mono_unichar4 *data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString *, mono_string_from_utf32, (/*const*/ mono_unichar4 *data))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_string_equal, (MonoString *s1, MonoString *s2))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_string_equal, (MonoString *s1, MonoString *s2))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY unsigned int, mono_string_hash, (MonoString *s))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY unsigned int, mono_string_hash, (MonoString *s))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_object_hash, (MonoObject* obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_object_hash, (MonoObject* obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoString *, mono_object_to_string, (MonoObject *obj, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoString *, mono_object_to_string, (MonoObject *obj, MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_value_box, (MonoDomain *domain, MonoClass *klass, void* val))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_value_box, (MonoDomain *domain, MonoClass *klass, void* val))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_value_copy, (void* dest, /*const*/ void* src, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_value_copy, (void* dest, /*const*/ void* src, MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_value_copy_array, (MonoArray *dest, int dest_idx, void* src, int count))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_value_copy_array, (MonoArray *dest, int dest_idx, void* src, int count))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoVTable*, mono_object_get_vtable, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoVTable*, mono_object_get_vtable, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_object_get_domain, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_object_get_domain, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_object_get_class, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_object_get_class, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_object_unbox, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_object_unbox, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_clone, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_clone, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst, (MonoObject *obj, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst, (MonoObject *obj, MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst_mbyref, (MonoObject *obj, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_isinst_mbyref, (MonoObject *obj, MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_castclass_mbyref, (MonoObject *obj, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_object_castclass_mbyref, (MonoObject *obj, MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_try_enter, (MonoObject *obj, uint32_t ms))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_try_enter, (MonoObject *obj, uint32_t ms))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_enter, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_monitor_enter, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_monitor_enter_v4, (MonoObject *obj, char *lock_taken))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_monitor_enter_v4, (MonoObject *obj, char *lock_taken))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY unsigned int, mono_object_get_size, (MonoObject *o))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY unsigned int, mono_object_get_size, (MonoObject *o))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_monitor_exit, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_monitor_exit, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_raise_exception, (MonoException *ex))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_raise_exception, (MonoException *ex))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_runtime_set_pending_exception, (MonoException *exc, mono_bool overwrite))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_runtime_set_pending_exception, (MonoException *exc, mono_bool overwrite))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_reraise_exception, (MonoException *ex))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_reraise_exception, (MonoException *ex))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_object_init, (MonoObject *this_obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_object_init, (MonoObject *this_obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_class_init, (MonoVTable *vtable))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_class_init, (MonoVTable *vtable))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_vtable_domain, (MonoVTable *vtable))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoDomain*, mono_vtable_domain, (MonoVTable *vtable))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoClass*, mono_vtable_class, (MonoVTable *vtable))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoClass*, mono_vtable_class, (MonoVTable *vtable))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_object_get_virtual_method, (MonoObject *obj, MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_object_get_virtual_method, (MonoObject *obj, MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke, (MonoMethod *method, void *obj, void **params, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke, (MonoMethod *method, void *obj, void **params, MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_invoke, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_invoke, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_begin_invoke, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_begin_invoke, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_end_invoke, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoMethod*, mono_get_delegate_end_invoke, (MonoClass *klass))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_delegate_invoke, (MonoObject *delegate, void **params, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_delegate_invoke, (MonoObject *delegate, void **params, MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke_array, (MonoMethod *method, void *obj, MonoArray *params, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_runtime_invoke_array, (MonoMethod *method, void *obj, MonoArray *params, MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_method_get_unmanaged_thunk, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_method_get_unmanaged_thunk, (MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_runtime_get_main_args, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_runtime_get_main_args, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_runtime_exec_managed_code, (MonoDomain *domain, MonoMainThreadFunc main_func, void* main_args))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_runtime_exec_managed_code, (MonoDomain *domain, MonoMainThreadFunc main_func, void* main_args))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_runtime_run_main, (MonoMethod *method, int argc, char* argv[],MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_runtime_run_main, (MonoMethod *method, int argc, char* argv[],MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_runtime_exec_main, (MonoMethod *method, MonoArray *args, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_runtime_exec_main, (MonoMethod *method, MonoArray *args, MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_runtime_set_main_args, (int argc, char* argv[]))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_runtime_set_main_args, (int argc, char* argv[]))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_load_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void **res))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_load_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void **res))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_load_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_load_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void* val))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, void* val))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_store_remote_field_new, (MonoObject *this_obj, MonoClass *klass, MonoClassField *field, MonoObject *arg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_unhandled_exception, (MonoObject *exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_unhandled_exception, (MonoObject *exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_print_unhandled_exception, (MonoObject *exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_print_unhandled_exception, (MonoObject *exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void*, mono_compile_method, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void*, mono_compile_method, (MonoMethod *method))
 
 /* accessors for fields and properties */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_set_value, (MonoObject *obj, MonoClassField *field, void *value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_set_value, (MonoObject *obj, MonoClassField *field, void *value))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_static_set_value, (MonoVTable *vt, MonoClassField *field, void *value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_static_set_value, (MonoVTable *vt, MonoClassField *field, void *value))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_get_value, (MonoObject *obj, MonoClassField *field, void *value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_get_value, (MonoObject *obj, MonoClassField *field, void *value))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_field_static_get_value, (MonoVTable *vt, MonoClassField *field, void *value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_field_static_get_value, (MonoVTable *vt, MonoClassField *field, void *value))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject *, mono_field_get_value_object, (MonoDomain *domain, MonoClassField *field, MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject *, mono_field_get_value_object, (MonoDomain *domain, MonoClassField *field, MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_property_set_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_property_set_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_property_get_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_property_get_value, (MonoProperty *prop, void *obj, void **params, MonoObject **exc))
 
 /* GC handles support
  *
@@ -189,15 +189,15 @@ MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_property_get_
  * mono_gchandle_get_target () can be used to get the object referenced by both kinds
  * of handle: for a weakref handle, if an object has been collected, it will return NULL.
  */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new, (MonoObject *obj, mono_bool pinned))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new_weakref, (MonoObject *obj, mono_bool track_resurrection))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_gchandle_get_target, (uint32_t gchandle))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free, (uint32_t gchandle))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new, (MonoObject *obj, mono_bool pinned))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uint32_t, mono_gchandle_new_weakref, (MonoObject *obj, mono_bool track_resurrection))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_gchandle_get_target, (uint32_t gchandle))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free, (uint32_t gchandle))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_v2, (MonoObject *obj, mono_bool pinned))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_weakref_v2, (MonoObject *obj, mono_bool track_resurrection))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*,  mono_gchandle_get_target_v2,  (MonoGCHandle gchandle))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free_v2, (MonoGCHandle gchandle))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_v2, (MonoObject *obj, mono_bool pinned))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoGCHandle, mono_gchandle_new_weakref_v2, (MonoObject *obj, mono_bool track_resurrection))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*,  mono_gchandle_get_target_v2,  (MonoGCHandle gchandle))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free_v2, (MonoGCHandle gchandle))
 
 /* Reference queue support
  *
@@ -208,16 +208,16 @@ MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gchandle_free_v2, (M
  * The callback will be triggered once an object is both unreachable and finalized.
  */
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReferenceQueue*, mono_gc_reference_queue_new, (mono_reference_queue_callback callback))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_reference_queue_free, (MonoReferenceQueue *queue))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_gc_reference_queue_add, (MonoReferenceQueue *queue, MonoObject *obj, void *user_data))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReferenceQueue*, mono_gc_reference_queue_new, (mono_reference_queue_callback callback))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_reference_queue_free, (MonoReferenceQueue *queue))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_gc_reference_queue_add, (MonoReferenceQueue *queue, MonoObject *obj, void *user_data))
 
 /* GC write barriers support */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_field, (MonoObject *obj, void* field_ptr, MonoObject* value))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_arrayref, (MonoArray *arr, void* slot_ptr, MonoObject* value))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_arrayref_copy, (void* dest_ptr, /*const*/ void* src_ptr, int count))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store, (void* ptr, MonoObject* value))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store_atomic, (void *ptr, MonoObject *value))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_nostore, (void* ptr))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_value_copy, (void* dest, /*const*/ void* src, int count, MonoClass *klass))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_object_copy, (MonoObject* obj, MonoObject *src))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_field, (MonoObject *obj, void* field_ptr, MonoObject* value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_set_arrayref, (MonoArray *arr, void* slot_ptr, MonoObject* value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_arrayref_copy, (void* dest_ptr, /*const*/ void* src_ptr, int count))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store, (void* ptr, MonoObject* value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_store_atomic, (void *ptr, MonoObject *value))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_generic_nostore, (void* ptr))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_value_copy, (void* dest, /*const*/ void* src, int count, MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wbarrier_object_copy, (MonoObject* obj, MonoObject *src))
diff --git a/src/native/public/mono/metadata/details/opcodes-functions.h b/src/native/public/mono/metadata/details/opcodes-functions.h
index c63a5c427945c2..04444b8cbe5ce0 100644
--- a/src/native/public/mono/metadata/details/opcodes-functions.h
+++ b/src/native/public/mono/metadata/details/opcodes-functions.h
@@ -6,6 +6,6 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API const char*, mono_opcode_name, (int opcode))
+MONO_API_FUNCTION(const char*, mono_opcode_name, (int opcode))
 
-MONO_API_FUNCTION(MONO_API MonoOpcodeEnum, mono_opcode_value, (const mono_byte **ip, const mono_byte *end))
+MONO_API_FUNCTION(MonoOpcodeEnum, mono_opcode_value, (const mono_byte **ip, const mono_byte *end))
diff --git a/src/native/public/mono/metadata/details/profiler-functions.h b/src/native/public/mono/metadata/details/profiler-functions.h
index e02d8db506bf6f..828ccb2bed4596 100644
--- a/src/native/public/mono/metadata/details/profiler-functions.h
+++ b/src/native/public/mono/metadata/details/profiler-functions.h
@@ -6,25 +6,25 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_profiler_load, (const char *desc))
-MONO_API_FUNCTION(MONO_API MonoProfilerHandle, mono_profiler_create, (MonoProfiler *prof))
-MONO_API_FUNCTION(MONO_API void, mono_profiler_set_cleanup_callback, (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb))
+MONO_API_FUNCTION(void, mono_profiler_load, (const char *desc))
+MONO_API_FUNCTION(MonoProfilerHandle, mono_profiler_create, (MonoProfiler *prof))
+MONO_API_FUNCTION(void, mono_profiler_set_cleanup_callback, (MonoProfilerHandle handle, MonoProfilerCleanupCallback cb))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_coverage, (void))
-MONO_API_FUNCTION(MONO_API void, mono_profiler_set_coverage_filter_callback, (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_get_coverage_data, (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb))
+MONO_API_FUNCTION(mono_bool, mono_profiler_enable_coverage, (void))
+MONO_API_FUNCTION(void, mono_profiler_set_coverage_filter_callback, (MonoProfilerHandle handle, MonoProfilerCoverageFilterCallback cb))
+MONO_API_FUNCTION(mono_bool, mono_profiler_get_coverage_data, (MonoProfilerHandle handle, MonoMethod *method, MonoProfilerCoverageCallback cb))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_sampling, (MonoProfilerHandle handle))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_set_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_get_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq))
+MONO_API_FUNCTION(mono_bool, mono_profiler_enable_sampling, (MonoProfilerHandle handle))
+MONO_API_FUNCTION(mono_bool, mono_profiler_set_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode mode, uint32_t freq))
+MONO_API_FUNCTION(mono_bool, mono_profiler_get_sample_mode, (MonoProfilerHandle handle, MonoProfilerSampleMode *mode, uint32_t *freq))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_allocations, (void))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_clauses, (void))
+MONO_API_FUNCTION(mono_bool, mono_profiler_enable_allocations, (void))
+MONO_API_FUNCTION(mono_bool, mono_profiler_enable_clauses, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_profiler_set_call_instrumentation_filter_callback, (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_profiler_enable_call_context_introspection, (void))
-MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_this, (MonoProfilerCallContext *context))
-MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_argument, (MonoProfilerCallContext *context, uint32_t position))
-MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_local, (MonoProfilerCallContext *context, uint32_t position))
-MONO_API_FUNCTION(MONO_API void *, mono_profiler_call_context_get_result, (MonoProfilerCallContext *context))
-MONO_API_FUNCTION(MONO_API void, mono_profiler_call_context_free_buffer, (void *buffer))
+MONO_API_FUNCTION(void, mono_profiler_set_call_instrumentation_filter_callback, (MonoProfilerHandle handle, MonoProfilerCallInstrumentationFilterCallback cb))
+MONO_API_FUNCTION(mono_bool, mono_profiler_enable_call_context_introspection, (void))
+MONO_API_FUNCTION(void *, mono_profiler_call_context_get_this, (MonoProfilerCallContext *context))
+MONO_API_FUNCTION(void *, mono_profiler_call_context_get_argument, (MonoProfilerCallContext *context, uint32_t position))
+MONO_API_FUNCTION(void *, mono_profiler_call_context_get_local, (MonoProfilerCallContext *context, uint32_t position))
+MONO_API_FUNCTION(void *, mono_profiler_call_context_get_result, (MonoProfilerCallContext *context))
+MONO_API_FUNCTION(void, mono_profiler_call_context_free_buffer, (void *buffer))
diff --git a/src/native/public/mono/metadata/details/reflection-functions.h b/src/native/public/mono/metadata/details/reflection-functions.h
index 5cb0efef7efb4c..718db5eeea6730 100644
--- a/src/native/public/mono/metadata/details/reflection-functions.h
+++ b/src/native/public/mono/metadata/details/reflection-functions.h
@@ -6,59 +6,59 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY int, mono_reflection_parse_type, (char *name, MonoTypeNameParse *info))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_get_type, (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve))
-MONO_API_FUNCTION(MONO_API void, mono_reflection_free_type_info, (MonoTypeNameParse *info))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_from_name, (char *name, MonoImage *image))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY uint32_t, mono_reflection_get_token, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY int, mono_reflection_parse_type, (char *name, MonoTypeNameParse *info))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_get_type, (MonoImage* image, MonoTypeNameParse *info, mono_bool ignorecase, mono_bool *type_resolve))
+MONO_API_FUNCTION(void, mono_reflection_free_type_info, (MonoTypeNameParse *info))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_from_name, (char *name, MonoImage *image))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY uint32_t, mono_reflection_get_token, (MonoObject *obj))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly*, mono_assembly_get_object, (MonoDomain *domain, MonoAssembly *assembly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_get_object, (MonoDomain *domain, MonoImage *image))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_file_get_object, (MonoDomain *domain, MonoImage *image, int table_index))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionType*, mono_type_get_object, (MonoDomain *domain, MonoType *type))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionMethod*, mono_method_get_object, (MonoDomain *domain, MonoMethod *method, MonoClass *refclass))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionField*, mono_field_get_object, (MonoDomain *domain, MonoClass *klass, MonoClassField *field))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionProperty*, mono_property_get_object, (MonoDomain *domain, MonoClass *klass, MonoProperty *property))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionEvent*, mono_event_get_object, (MonoDomain *domain, MonoClass *klass, MonoEvent *event))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionAssembly*, mono_assembly_get_object, (MonoDomain *domain, MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_get_object, (MonoDomain *domain, MonoImage *image))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionModule*, mono_module_file_get_object, (MonoDomain *domain, MonoImage *image, int table_index))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionType*, mono_type_get_object, (MonoDomain *domain, MonoType *type))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionMethod*, mono_method_get_object, (MonoDomain *domain, MonoMethod *method, MonoClass *refclass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionField*, mono_field_get_object, (MonoDomain *domain, MonoClass *klass, MonoClassField *field))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionProperty*, mono_property_get_object, (MonoDomain *domain, MonoClass *klass, MonoProperty *property))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionEvent*, mono_event_get_object, (MonoDomain *domain, MonoClass *klass, MonoEvent *event))
 /* note: this one is slightly different: we keep the whole array of params in the cache */
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_param_get_objects, (MonoDomain *domain, MonoMethod *method))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoReflectionMethodBody*, mono_method_body_get_object, (MonoDomain *domain, MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_param_get_objects, (MonoDomain *domain, MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoReflectionMethodBody*, mono_method_body_get_object, (MonoDomain *domain, MonoMethod *method))
 
-MONO_API_FUNCTION(MONO_API MonoObject *, mono_get_dbnull_object, (MonoDomain *domain))
+MONO_API_FUNCTION(MonoObject *, mono_get_dbnull_object, (MonoDomain *domain))
 
-MONO_API_FUNCTION(MONO_API MonoArray*, mono_reflection_get_custom_attrs_by_type, (MonoObject *obj, MonoClass *attr_klass, MonoError *error))
-MONO_API_FUNCTION(MONO_API MonoArray*, mono_reflection_get_custom_attrs, (MonoObject *obj))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_data, (MonoObject *obj))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_blob, (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues))
+MONO_API_FUNCTION(MonoArray*, mono_reflection_get_custom_attrs_by_type, (MonoObject *obj, MonoClass *attr_klass, MonoError *error))
+MONO_API_FUNCTION(MonoArray*, mono_reflection_get_custom_attrs, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_data, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_reflection_get_custom_attrs_blob, (MonoReflectionAssembly *assembly, MonoObject *ctor, MonoArray *ctorArgs, MonoArray *properties, MonoArray *porpValues, MonoArray *fields, MonoArray* fieldValues))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_reflection_get_custom_attrs_info, (MonoObject *obj))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoArray*, mono_custom_attrs_construct, (MonoCustomAttrInfo *cinfo))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_index, (MonoImage *image, uint32_t idx))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_method, (MonoMethod *method))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_class, (MonoClass *klass))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_assembly, (MonoAssembly *assembly))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_property, (MonoClass *klass, MonoProperty *property))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_event, (MonoClass *klass, MonoEvent *event))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_field, (MonoClass *klass, MonoClassField *field))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_param, (MonoMethod *method, uint32_t param))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_custom_attrs_has_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoObject*, mono_custom_attrs_get_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass))
-MONO_API_FUNCTION(MONO_API void, mono_custom_attrs_free, (MonoCustomAttrInfo *ainfo))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_reflection_get_custom_attrs_info, (MonoObject *obj))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoArray*, mono_custom_attrs_construct, (MonoCustomAttrInfo *cinfo))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_index, (MonoImage *image, uint32_t idx))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_method, (MonoMethod *method))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_class, (MonoClass *klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_assembly, (MonoAssembly *assembly))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_property, (MonoClass *klass, MonoProperty *property))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_event, (MonoClass *klass, MonoEvent *event))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_field, (MonoClass *klass, MonoClassField *field))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoCustomAttrInfo*, mono_custom_attrs_from_param, (MonoMethod *method, uint32_t param))
+MONO_API_FUNCTION(mono_bool, mono_custom_attrs_has_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoObject*, mono_custom_attrs_get_attr, (MonoCustomAttrInfo *ainfo, MonoClass *attr_klass))
+MONO_API_FUNCTION(void, mono_custom_attrs_free, (MonoCustomAttrInfo *ainfo))
 
 
-MONO_API_FUNCTION(MONO_API uint32_t, mono_declsec_flags_from_method, (MonoMethod *method))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_declsec_flags_from_class, (MonoClass *klass))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_declsec_flags_from_assembly, (MonoAssembly *assembly))
+MONO_API_FUNCTION(uint32_t, mono_declsec_flags_from_method, (MonoMethod *method))
+MONO_API_FUNCTION(uint32_t, mono_declsec_flags_from_class, (MonoClass *klass))
+MONO_API_FUNCTION(uint32_t, mono_declsec_flags_from_assembly, (MonoAssembly *assembly))
 
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_demands, (MonoMethod *callee, MonoDeclSecurityActions* demands))
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_linkdemands, (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* cmethod))
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_inheritdemands_class, (MonoClass *klass, MonoDeclSecurityActions* demands))
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_inheritdemands_method, (MonoMethod *callee, MonoDeclSecurityActions* demands))
+MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_demands, (MonoMethod *callee, MonoDeclSecurityActions* demands))
+MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_linkdemands, (MonoMethod *callee, MonoDeclSecurityActions* klass, MonoDeclSecurityActions* cmethod))
+MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_inheritdemands_class, (MonoClass *klass, MonoDeclSecurityActions* demands))
+MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_inheritdemands_method, (MonoMethod *callee, MonoDeclSecurityActions* demands))
 
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_method_action, (MonoMethod *method, uint32_t action, MonoDeclSecurityEntry *entry))
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_class_action, (MonoClass *klass, uint32_t action, MonoDeclSecurityEntry *entry))
-MONO_API_FUNCTION(MONO_API MonoBoolean, mono_declsec_get_assembly_action, (MonoAssembly *assembly, uint32_t action, MonoDeclSecurityEntry *entry))
+MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_method_action, (MonoMethod *method, uint32_t action, MonoDeclSecurityEntry *entry))
+MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_class_action, (MonoClass *klass, uint32_t action, MonoDeclSecurityEntry *entry))
+MONO_API_FUNCTION(MonoBoolean, mono_declsec_get_assembly_action, (MonoAssembly *assembly, uint32_t action, MonoDeclSecurityEntry *entry))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_get_type, (MonoReflectionType *reftype))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoType*, mono_reflection_type_get_type, (MonoReflectionType *reftype))
 
-MONO_API_FUNCTION(MONO_API MonoAssembly*, mono_reflection_assembly_get_assembly, (MonoReflectionAssembly *refassembly))
+MONO_API_FUNCTION(MonoAssembly*, mono_reflection_assembly_get_assembly, (MonoReflectionAssembly *refassembly))
diff --git a/src/native/public/mono/metadata/details/sgen-bridge-functions.h b/src/native/public/mono/metadata/details/sgen-bridge-functions.h
index 877bf3aa400106..dc1c55274c46cc 100644
--- a/src/native/public/mono/metadata/details/sgen-bridge-functions.h
+++ b/src/native/public/mono/metadata/details/sgen-bridge-functions.h
@@ -11,6 +11,6 @@
  * with (during and on a separate thread from) sgen init. Callers are
  * responsible for enforcing this.
  */
-MONO_API_FUNCTION(MONO_API void, mono_gc_register_bridge_callbacks, (MonoGCBridgeCallbacks *callbacks))
+MONO_API_FUNCTION(void, mono_gc_register_bridge_callbacks, (MonoGCBridgeCallbacks *callbacks))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_gc_wait_for_bridge_processing, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_gc_wait_for_bridge_processing, (void))
diff --git a/src/native/public/mono/metadata/details/threads-functions.h b/src/native/public/mono/metadata/details/threads-functions.h
index 37d10e740f9148..9fb30316d0a105 100644
--- a/src/native/public/mono/metadata/details/threads-functions.h
+++ b/src/native/public/mono/metadata/details/threads-functions.h
@@ -6,37 +6,37 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_thread_init, (MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_cleanup, (void))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_manage, (void))
+MONO_API_FUNCTION(void, mono_thread_init, (MonoThreadStartCB start_cb, MonoThreadAttachCB attach_cb))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_cleanup, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_manage, (void))
 
-MONO_API_FUNCTION(MONO_API MonoThread *, mono_thread_current, (void))
+MONO_API_FUNCTION(MonoThread *, mono_thread_current, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_thread_set_main, (MonoThread *thread))
-MONO_API_FUNCTION(MONO_API MonoThread *, mono_thread_get_main, (void))
+MONO_API_FUNCTION(void, mono_thread_set_main, (MonoThread *thread))
+MONO_API_FUNCTION(MonoThread *, mono_thread_get_main, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_stop, (MonoThread *thread))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_stop, (MonoThread *thread))
 
-MONO_API_FUNCTION(MONO_API void, mono_thread_new_init, (intptr_t tid, void* stack_start, void* func))
+MONO_API_FUNCTION(void, mono_thread_new_init, (intptr_t tid, void* stack_start, void* func))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_create, (MonoDomain *domain, void* func, void* arg))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_create, (MonoDomain *domain, void* func, void* arg))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY MonoThread *, mono_thread_attach, (MonoDomain *domain))
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_thread_detach, (MonoThread *thread))
-MONO_API_FUNCTION(MONO_API void, mono_thread_exit, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY MonoThread *, mono_thread_attach, (MonoDomain *domain))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_thread_detach, (MonoThread *thread))
+MONO_API_FUNCTION(void, mono_thread_exit, (void))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_threads_attach_tools_thread, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_threads_attach_tools_thread, (void))
 
-MONO_API_FUNCTION(MONO_API char *, mono_thread_get_name_utf8, (MonoThread *thread))
-MONO_API_FUNCTION(MONO_API int32_t, mono_thread_get_managed_id, (MonoThread *thread))
+MONO_API_FUNCTION(char *, mono_thread_get_name_utf8, (MonoThread *thread))
+MONO_API_FUNCTION(int32_t, mono_thread_get_managed_id, (MonoThread *thread))
 
-MONO_API_FUNCTION(MONO_API void, mono_thread_set_manage_callback, (MonoThread *thread, MonoThreadManageCallback func))
+MONO_API_FUNCTION(void, mono_thread_set_manage_callback, (MonoThread *thread, MonoThreadManageCallback func))
 
-MONO_API_FUNCTION(MONO_API void, mono_threads_set_default_stacksize, (uint32_t stacksize))
-MONO_API_FUNCTION(MONO_API uint32_t, mono_threads_get_default_stacksize, (void))
+MONO_API_FUNCTION(void, mono_threads_set_default_stacksize, (uint32_t stacksize))
+MONO_API_FUNCTION(uint32_t, mono_threads_get_default_stacksize, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_threads_request_thread_dump, (void))
+MONO_API_FUNCTION(void, mono_threads_request_thread_dump, (void))
 
-MONO_API_FUNCTION(MONO_API mono_bool, mono_thread_is_foreign, (MonoThread *thread))
+MONO_API_FUNCTION(mono_bool, mono_thread_is_foreign, (MonoThread *thread))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_thread_detach_if_exiting, (void))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_thread_detach_if_exiting, (void))
diff --git a/src/native/public/mono/utils/details/mono-counters-functions.h b/src/native/public/mono/utils/details/mono-counters-functions.h
index 5f6486f2311001..2fdda7285f6636 100644
--- a/src/native/public/mono/utils/details/mono-counters-functions.h
+++ b/src/native/public/mono/utils/details/mono-counters-functions.h
@@ -6,37 +6,37 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_counters_enable, (int section_mask))
-MONO_API_FUNCTION(MONO_API void, mono_counters_init, (void))
+MONO_API_FUNCTION(void, mono_counters_enable, (int section_mask))
+MONO_API_FUNCTION(void, mono_counters_init, (void))
 
 /*
  * register addr as the address of a counter of type type.
  * It may be a function pointer if MONO_COUNTER_CALLBACK is specified:
  * the function should return the value and take no arguments.
  */
-MONO_API_FUNCTION(MONO_API void, mono_counters_register, (const char* descr, int type, void *addr))
-MONO_API_FUNCTION(MONO_API void, mono_counters_register_with_size, (const char *name, int type, void *addr, int size))
+MONO_API_FUNCTION(void, mono_counters_register, (const char* descr, int type, void *addr))
+MONO_API_FUNCTION(void, mono_counters_register_with_size, (const char *name, int type, void *addr, int size))
 
-MONO_API_FUNCTION(MONO_API void, mono_counters_on_register, (MonoCounterRegisterCallback callback))
+MONO_API_FUNCTION(void, mono_counters_on_register, (MonoCounterRegisterCallback callback))
 
 /*
  * Create a readable dump of the counters for section_mask sections (ORed section values)
  */
-MONO_API_FUNCTION(MONO_API void, mono_counters_dump, (int section_mask, FILE *outfile))
+MONO_API_FUNCTION(void, mono_counters_dump, (int section_mask, FILE *outfile))
 
-MONO_API_FUNCTION(MONO_API void, mono_counters_cleanup, (void))
+MONO_API_FUNCTION(void, mono_counters_cleanup, (void))
 
-MONO_API_FUNCTION(MONO_API void, mono_counters_foreach, (CountersEnumCallback cb, void *user_data))
+MONO_API_FUNCTION(void, mono_counters_foreach, (CountersEnumCallback cb, void *user_data))
 
-MONO_API_FUNCTION(MONO_API int, mono_counters_sample, (MonoCounter *counter, void *buffer, int buffer_size))
+MONO_API_FUNCTION(int, mono_counters_sample, (MonoCounter *counter, void *buffer, int buffer_size))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_counter_get_name, (MonoCounter *name))
-MONO_API_FUNCTION(MONO_API int, mono_counter_get_type, (MonoCounter *counter))
-MONO_API_FUNCTION(MONO_API int, mono_counter_get_section, (MonoCounter *counter))
-MONO_API_FUNCTION(MONO_API int, mono_counter_get_unit, (MonoCounter *counter))
-MONO_API_FUNCTION(MONO_API int, mono_counter_get_variance, (MonoCounter *counter))
-MONO_API_FUNCTION(MONO_API size_t, mono_counter_get_size, (MonoCounter *counter))
+MONO_API_FUNCTION(const char*, mono_counter_get_name, (MonoCounter *name))
+MONO_API_FUNCTION(int, mono_counter_get_type, (MonoCounter *counter))
+MONO_API_FUNCTION(int, mono_counter_get_section, (MonoCounter *counter))
+MONO_API_FUNCTION(int, mono_counter_get_unit, (MonoCounter *counter))
+MONO_API_FUNCTION(int, mono_counter_get_variance, (MonoCounter *counter))
+MONO_API_FUNCTION(size_t, mono_counter_get_size, (MonoCounter *counter))
 
-MONO_API_FUNCTION(MONO_API int,  mono_runtime_resource_limit, (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit))
-MONO_API_FUNCTION(MONO_API void, mono_runtime_resource_set_callback, (MonoResourceCallback callback))
-MONO_API_FUNCTION(MONO_API void, mono_runtime_resource_check_limit,  (int resource_type, uintptr_t value))
+MONO_API_FUNCTION(int,  mono_runtime_resource_limit, (int resource_type, uintptr_t soft_limit, uintptr_t hard_limit))
+MONO_API_FUNCTION(void, mono_runtime_resource_set_callback, (MonoResourceCallback callback))
+MONO_API_FUNCTION(void, mono_runtime_resource_check_limit,  (int resource_type, uintptr_t value))
diff --git a/src/native/public/mono/utils/details/mono-dl-fallback-functions.h b/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
index 67733c790cca35..6c9cfac72684af 100644
--- a/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
+++ b/src/native/public/mono/utils/details/mono-dl-fallback-functions.h
@@ -6,6 +6,6 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MonoDlFallbackHandler *, mono_dl_fallback_register, (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func, \
+MONO_API_FUNCTION(MonoDlFallbackHandler *, mono_dl_fallback_register, (MonoDlFallbackLoad load_func, MonoDlFallbackSymbol symbol_func, \
 										MonoDlFallbackClose close_func, void *user_data))
-MONO_API_FUNCTION(MONO_API void, mono_dl_fallback_unregister, (MonoDlFallbackHandler *handler))
+MONO_API_FUNCTION(void, mono_dl_fallback_unregister, (MonoDlFallbackHandler *handler))
diff --git a/src/native/public/mono/utils/details/mono-error-functions.h b/src/native/public/mono/utils/details/mono-error-functions.h
index a5f1ec10c41fab..696b32d68b8da0 100644
--- a/src/native/public/mono/utils/details/mono-error-functions.h
+++ b/src/native/public/mono/utils/details/mono-error-functions.h
@@ -6,13 +6,13 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY void, mono_error_init, (MonoError *error))
-MONO_API_FUNCTION(MONO_API void, mono_error_init_flags, (MonoError *error, unsigned short flags))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY void, mono_error_init, (MonoError *error))
+MONO_API_FUNCTION(void, mono_error_init_flags, (MonoError *error, unsigned short flags))
 
-MONO_API_FUNCTION(MONO_API void, mono_error_cleanup, (MonoError *error))
+MONO_API_FUNCTION(void, mono_error_cleanup, (MonoError *error))
 
-MONO_API_FUNCTION(MONO_API MONO_RT_EXTERNAL_ONLY mono_bool, mono_error_ok, (MonoError *error))
+MONO_API_FUNCTION(MONO_RT_EXTERNAL_ONLY mono_bool, mono_error_ok, (MonoError *error))
 
-MONO_API_FUNCTION(MONO_API unsigned short, mono_error_get_error_code, (MonoError *error))
+MONO_API_FUNCTION(unsigned short, mono_error_get_error_code, (MonoError *error))
 
-MONO_API_FUNCTION(MONO_API const char*, mono_error_get_message, (MonoError *error))
+MONO_API_FUNCTION(const char*, mono_error_get_message, (MonoError *error))
diff --git a/src/native/public/mono/utils/details/mono-logger-functions.h b/src/native/public/mono/utils/details/mono-logger-functions.h
index 8c91f13b9047fa..d24100f6ea69b9 100644
--- a/src/native/public/mono/utils/details/mono-logger-functions.h
+++ b/src/native/public/mono/utils/details/mono-logger-functions.h
@@ -6,12 +6,12 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_trace_set_level_string, (const char *value))
+MONO_API_FUNCTION(void, mono_trace_set_level_string, (const char *value))
 
-MONO_API_FUNCTION(MONO_API void, mono_trace_set_mask_string, (const char *value))
+MONO_API_FUNCTION(void, mono_trace_set_mask_string, (const char *value))
 
-MONO_API_FUNCTION(MONO_API void, mono_trace_set_log_handler, (MonoLogCallback callback, void *user_data))
+MONO_API_FUNCTION(void, mono_trace_set_log_handler, (MonoLogCallback callback, void *user_data))
 
-MONO_API_FUNCTION(MONO_API void, mono_trace_set_print_handler, (MonoPrintCallback callback))
+MONO_API_FUNCTION(void, mono_trace_set_print_handler, (MonoPrintCallback callback))
 
-MONO_API_FUNCTION(MONO_API void, mono_trace_set_printerr_handler, (MonoPrintCallback callback))
+MONO_API_FUNCTION(void, mono_trace_set_printerr_handler, (MonoPrintCallback callback))
diff --git a/src/native/public/mono/utils/details/mono-publib-functions.h b/src/native/public/mono/utils/details/mono-publib-functions.h
index 71d4ba836598c9..d6186b08d9e534 100644
--- a/src/native/public/mono/utils/details/mono-publib-functions.h
+++ b/src/native/public/mono/utils/details/mono-publib-functions.h
@@ -6,6 +6,6 @@
 #error "MONO_API_FUNCTION(ret,name,args) macro not defined before including function declaration header"
 #endif
 
-MONO_API_FUNCTION(MONO_API void, mono_free, (void*))
-MONO_API_FUNCTION(MONO_API mono_bool, mono_set_allocator_vtable, (MonoAllocatorVTable* vtable))
+MONO_API_FUNCTION(void, mono_free, (void*))
+MONO_API_FUNCTION(mono_bool, mono_set_allocator_vtable, (MonoAllocatorVTable* vtable))
 

From 7bb7838e864dc4074b9178b72dafa5bcc1148974 Mon Sep 17 00:00:00 2001
From: Aleksey Kliger <alklig@microsoft.com>
Date: Wed, 23 Feb 2022 14:22:19 -0500
Subject: [PATCH 14/14] redefine MONO_API_FUNCTION to include MONO_API

---
 src/native/public/mono/jit/jit.h                        | 2 +-
 src/native/public/mono/jit/mono-private-unstable.h      | 2 +-
 src/native/public/mono/metadata/appdomain.h             | 2 +-
 src/native/public/mono/metadata/assembly.h              | 2 +-
 src/native/public/mono/metadata/class.h                 | 2 +-
 src/native/public/mono/metadata/debug-helpers.h         | 2 +-
 src/native/public/mono/metadata/environment.h           | 2 +-
 src/native/public/mono/metadata/exception.h             | 2 +-
 src/native/public/mono/metadata/image.h                 | 2 +-
 src/native/public/mono/metadata/loader.h                | 2 +-
 src/native/public/mono/metadata/metadata.h              | 2 +-
 src/native/public/mono/metadata/mono-config.h           | 2 +-
 src/native/public/mono/metadata/mono-debug.h            | 2 +-
 src/native/public/mono/metadata/mono-gc.h               | 2 +-
 src/native/public/mono/metadata/mono-private-unstable.h | 2 +-
 src/native/public/mono/metadata/object.h                | 2 +-
 src/native/public/mono/metadata/opcodes.h               | 2 +-
 src/native/public/mono/metadata/profiler.h              | 2 +-
 src/native/public/mono/metadata/reflection.h            | 2 +-
 src/native/public/mono/metadata/sgen-bridge.h           | 2 +-
 src/native/public/mono/metadata/threads.h               | 2 +-
 src/native/public/mono/utils/mono-counters.h            | 2 +-
 src/native/public/mono/utils/mono-dl-fallback.h         | 2 +-
 src/native/public/mono/utils/mono-error.h               | 2 +-
 src/native/public/mono/utils/mono-logger.h              | 2 +-
 src/native/public/mono/utils/mono-publib.h              | 2 +-
 26 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/src/native/public/mono/jit/jit.h b/src/native/public/mono/jit/jit.h
index 1ad43823ce529a..8c5323f96bcfa8 100644
--- a/src/native/public/mono/jit/jit.h
+++ b/src/native/public/mono/jit/jit.h
@@ -13,7 +13,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/jit/details/jit-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/jit/mono-private-unstable.h b/src/native/public/mono/jit/mono-private-unstable.h
index 5a6fcb66c6dd15..006c0cfe5c64cb 100644
--- a/src/native/public/mono/jit/mono-private-unstable.h
+++ b/src/native/public/mono/jit/mono-private-unstable.h
@@ -16,7 +16,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/jit/details/mono-private-unstable-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/appdomain.h b/src/native/public/mono/metadata/appdomain.h
index e32d2a566f2573..db135f1c35b092 100644
--- a/src/native/public/mono/metadata/appdomain.h
+++ b/src/native/public/mono/metadata/appdomain.h
@@ -15,7 +15,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/appdomain-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/assembly.h b/src/native/public/mono/metadata/assembly.h
index 1c4b80676f7e95..b528dc96368f8b 100644
--- a/src/native/public/mono/metadata/assembly.h
+++ b/src/native/public/mono/metadata/assembly.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/assembly-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/class.h b/src/native/public/mono/metadata/class.h
index 0e59115d7d96ac..f3435420d777c9 100644
--- a/src/native/public/mono/metadata/class.h
+++ b/src/native/public/mono/metadata/class.h
@@ -14,7 +14,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/class-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/debug-helpers.h b/src/native/public/mono/metadata/debug-helpers.h
index 515a17e6418ff5..4f0bde1777af6a 100644
--- a/src/native/public/mono/metadata/debug-helpers.h
+++ b/src/native/public/mono/metadata/debug-helpers.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/debug-helpers-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/environment.h b/src/native/public/mono/metadata/environment.h
index 7cf36f0483dd9c..0ae5c050ba9a2e 100644
--- a/src/native/public/mono/metadata/environment.h
+++ b/src/native/public/mono/metadata/environment.h
@@ -15,7 +15,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/environment-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/exception.h b/src/native/public/mono/metadata/exception.h
index 1d66ff054a30aa..25caa389fd8adc 100644
--- a/src/native/public/mono/metadata/exception.h
+++ b/src/native/public/mono/metadata/exception.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/exception-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/image.h b/src/native/public/mono/metadata/image.h
index f0a22034c6e74e..5dd28b830c6d82 100644
--- a/src/native/public/mono/metadata/image.h
+++ b/src/native/public/mono/metadata/image.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/image-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/loader.h b/src/native/public/mono/metadata/loader.h
index 2d27f5f803eaf4..bb6b53cf32def0 100644
--- a/src/native/public/mono/metadata/loader.h
+++ b/src/native/public/mono/metadata/loader.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/loader-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/metadata.h b/src/native/public/mono/metadata/metadata.h
index 989d3393bab9cf..928f38f03ebf0b 100644
--- a/src/native/public/mono/metadata/metadata.h
+++ b/src/native/public/mono/metadata/metadata.h
@@ -50,7 +50,7 @@ MONO_BEGIN_DECLS
 
 #define mono_metadata_token_code(token) ((token) & 0xff000000)
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/metadata-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/mono-config.h b/src/native/public/mono/metadata/mono-config.h
index 517e393611bf7d..32028fbe1971f9 100644
--- a/src/native/public/mono/metadata/mono-config.h
+++ b/src/native/public/mono/metadata/mono-config.h
@@ -12,7 +12,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/mono-config-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/mono-debug.h b/src/native/public/mono/metadata/mono-debug.h
index e7ab60f1095e0e..95f7970ce001fc 100644
--- a/src/native/public/mono/metadata/mono-debug.h
+++ b/src/native/public/mono/metadata/mono-debug.h
@@ -11,7 +11,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/mono-debug-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/mono-gc.h b/src/native/public/mono/metadata/mono-gc.h
index b89b3fb6b5a9cd..1905f177086399 100644
--- a/src/native/public/mono/metadata/mono-gc.h
+++ b/src/native/public/mono/metadata/mono-gc.h
@@ -10,7 +10,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/mono-gc-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/mono-private-unstable.h b/src/native/public/mono/metadata/mono-private-unstable.h
index 1354c09d6d632b..a13e53e01c5375 100644
--- a/src/native/public/mono/metadata/mono-private-unstable.h
+++ b/src/native/public/mono/metadata/mono-private-unstable.h
@@ -19,7 +19,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/mono-private-unstable-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/object.h b/src/native/public/mono/metadata/object.h
index 434455a6656151..359fa518cce7c1 100644
--- a/src/native/public/mono/metadata/object.h
+++ b/src/native/public/mono/metadata/object.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/object-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/opcodes.h b/src/native/public/mono/metadata/opcodes.h
index 994d70f2a51b5c..92dc15d2714133 100644
--- a/src/native/public/mono/metadata/opcodes.h
+++ b/src/native/public/mono/metadata/opcodes.h
@@ -19,7 +19,7 @@
 MONO_BEGIN_DECLS
 MONO_API_DATA const MonoOpcode mono_opcodes [];
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/opcodes-functions.h>
 #undef MONO_API_FUNCTION
 MONO_END_DECLS
diff --git a/src/native/public/mono/metadata/profiler.h b/src/native/public/mono/metadata/profiler.h
index 9a66aa952e47eb..13cf7bb143b139 100644
--- a/src/native/public/mono/metadata/profiler.h
+++ b/src/native/public/mono/metadata/profiler.h
@@ -30,7 +30,7 @@ MONO_BEGIN_DECLS
  */
 #define MONO_PROFILER_API_VERSION 3
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/profiler-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/reflection.h b/src/native/public/mono/metadata/reflection.h
index b61037a676dca2..c8f62d4fc76e57 100644
--- a/src/native/public/mono/metadata/reflection.h
+++ b/src/native/public/mono/metadata/reflection.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/reflection-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/sgen-bridge.h b/src/native/public/mono/metadata/sgen-bridge.h
index 453c7285bb6b6b..bb119e5e31d8bb 100644
--- a/src/native/public/mono/metadata/sgen-bridge.h
+++ b/src/native/public/mono/metadata/sgen-bridge.h
@@ -56,7 +56,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/sgen-bridge-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/metadata/threads.h b/src/native/public/mono/metadata/threads.h
index 8a9e2185851baa..3d11ade9184cbd 100644
--- a/src/native/public/mono/metadata/threads.h
+++ b/src/native/public/mono/metadata/threads.h
@@ -16,7 +16,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/metadata/details/threads-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/utils/mono-counters.h b/src/native/public/mono/utils/mono-counters.h
index fe3f1008ae578e..6455c2e54b03fa 100644
--- a/src/native/public/mono/utils/mono-counters.h
+++ b/src/native/public/mono/utils/mono-counters.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/utils/details/mono-counters-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/utils/mono-dl-fallback.h b/src/native/public/mono/utils/mono-dl-fallback.h
index b7919e5962eecd..53d4dc30e7a177 100644
--- a/src/native/public/mono/utils/mono-dl-fallback.h
+++ b/src/native/public/mono/utils/mono-dl-fallback.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/utils/details/mono-dl-fallback-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/utils/mono-error.h b/src/native/public/mono/utils/mono-error.h
index 4c3badfe2131f7..c30c62f0d023d3 100644
--- a/src/native/public/mono/utils/mono-error.h
+++ b/src/native/public/mono/utils/mono-error.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/utils/details/mono-error-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/utils/mono-logger.h b/src/native/public/mono/utils/mono-logger.h
index 4b063d76b5aa17..477e3626d1b88c 100644
--- a/src/native/public/mono/utils/mono-logger.h
+++ b/src/native/public/mono/utils/mono-logger.h
@@ -10,7 +10,7 @@ MONO_BEGIN_DECLS
 
 #include <mono/utils/details/mono-logger-types.h>
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/utils/details/mono-logger-functions.h>
 #undef MONO_API_FUNCTION
 
diff --git a/src/native/public/mono/utils/mono-publib.h b/src/native/public/mono/utils/mono-publib.h
index e70a7dcac38db1..72f91a20bbc8ee 100644
--- a/src/native/public/mono/utils/mono-publib.h
+++ b/src/native/public/mono/utils/mono-publib.h
@@ -9,7 +9,7 @@
 
 MONO_BEGIN_DECLS
 
-#define MONO_API_FUNCTION(ret,name,args) ret name args;
+#define MONO_API_FUNCTION(ret,name,args) MONO_API ret name args;
 #include <mono/utils/details/mono-publib-functions.h>
 #undef MONO_API_FUNCTION
 
