1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 17:44:48 +09:00

Fix x86 clrgc loading (#81176)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
This commit is contained in:
Andrew Au 2023-01-27 15:43:56 -08:00 committed by GitHub
parent 59719477cf
commit ec06321141
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 9 deletions

View file

@ -110,7 +110,7 @@ struct VersionInfo {
const char* Name;
};
extern "C" void GC_VersionInfo(
extern "C" void LOCALGC_CALLCONV GC_VersionInfo(
/* Out */ VersionInfo*
);
```
@ -142,7 +142,7 @@ Once the EE has verified that the version of the candidate GC is valid, it then
GC. It does so by loading (via `GetProcAddress`) and executing a function with this signature:
```c++
extern "C" HRESULT GC_Initialize(
extern "C" HRESULT LOCALGC_CALLCONV GC_Initialize(
/* In */ IGCToCLR*,
/* Out */ IGCHeap**.
/* Out */ IGCHandleManager**,

View file

@ -1061,11 +1061,17 @@ struct VersionInfo {
const char* Name;
};
typedef void (*GC_VersionInfoFunction)(
#ifdef TARGET_X86
#define LOCALGC_CALLCONV __cdecl
#else
#define LOCALGC_CALLCONV
#endif
typedef void (LOCALGC_CALLCONV *GC_VersionInfoFunction)(
/* Out */ VersionInfo*
);
typedef HRESULT (*GC_InitializeFunction)(
typedef HRESULT (LOCALGC_CALLCONV *GC_InitializeFunction)(
/* In */ IGCToCLR*,
/* Out */ IGCHeap**,
/* Out */ IGCHandleManager**,

View file

@ -42,7 +42,7 @@ namespace SVR
extern void PopulateHandleTableDacVars(GcDacVars* dacVars);
GC_EXPORT
void
void LOCALGC_CALLCONV
GC_VersionInfo(/* InOut */ VersionInfo* info)
{
#ifdef BUILD_AS_STANDALONE
@ -59,7 +59,7 @@ GC_VersionInfo(/* InOut */ VersionInfo* info)
}
GC_EXPORT
HRESULT
HRESULT LOCALGC_CALLCONV
GC_Initialize(
/* In */ IGCToCLR* clrToGC,
/* Out */ IGCHeap** gcHeap,

View file

@ -47,6 +47,12 @@
#include "gcdesc.h"
#ifdef TARGET_X86
#define LOCALGC_CALLCONV __cdecl
#else
#define LOCALGC_CALLCONV
#endif
//
// The fast paths for object allocation and write barriers is performance critical. They are often
// hand written in assembly code, etc.
@ -106,7 +112,7 @@ void WriteBarrier(Object ** dst, Object * ref)
ErectWriteBarrier(dst, ref);
}
extern "C" HRESULT GC_Initialize(IGCToCLR* clrToGC, IGCHeap** gcHeap, IGCHandleManager** gcHandleManager, GcDacVars* gcDacVars);
extern "C" HRESULT LOCALGC_CALLCONV GC_Initialize(IGCToCLR* clrToGC, IGCHeap** gcHeap, IGCHandleManager** gcHandleManager, GcDacVars* gcDacVars);
int __cdecl main(int argc, char* argv[])
{

View file

@ -66,8 +66,8 @@ bool GCHeapUtilities::s_useThreadAllocationContexts;
// GC entrypoints for the linked-in GC. These symbols are invoked
// directly if we are not using a standalone GC.
extern "C" void GC_VersionInfo(/* Out */ VersionInfo* info);
extern "C" HRESULT GC_Initialize(
extern "C" void LOCALGC_CALLCONV GC_VersionInfo(/* Out */ VersionInfo* info);
extern "C" HRESULT LOCALGC_CALLCONV GC_Initialize(
/* In */ IGCToCLR* clrToGC,
/* Out */ IGCHeap** gcHeap,
/* Out */ IGCHandleManager** gcHandleManager,