mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 10:18:21 +09:00
Fix x86 clrgc loading (#81176)
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
This commit is contained in:
parent
59719477cf
commit
ec06321141
5 changed files with 21 additions and 9 deletions
|
@ -110,7 +110,7 @@ struct VersionInfo {
|
||||||
const char* Name;
|
const char* Name;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" void GC_VersionInfo(
|
extern "C" void LOCALGC_CALLCONV GC_VersionInfo(
|
||||||
/* Out */ 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:
|
GC. It does so by loading (via `GetProcAddress`) and executing a function with this signature:
|
||||||
|
|
||||||
```c++
|
```c++
|
||||||
extern "C" HRESULT GC_Initialize(
|
extern "C" HRESULT LOCALGC_CALLCONV GC_Initialize(
|
||||||
/* In */ IGCToCLR*,
|
/* In */ IGCToCLR*,
|
||||||
/* Out */ IGCHeap**.
|
/* Out */ IGCHeap**.
|
||||||
/* Out */ IGCHandleManager**,
|
/* Out */ IGCHandleManager**,
|
||||||
|
|
|
@ -1061,11 +1061,17 @@ struct VersionInfo {
|
||||||
const char* Name;
|
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*
|
/* Out */ VersionInfo*
|
||||||
);
|
);
|
||||||
|
|
||||||
typedef HRESULT (*GC_InitializeFunction)(
|
typedef HRESULT (LOCALGC_CALLCONV *GC_InitializeFunction)(
|
||||||
/* In */ IGCToCLR*,
|
/* In */ IGCToCLR*,
|
||||||
/* Out */ IGCHeap**,
|
/* Out */ IGCHeap**,
|
||||||
/* Out */ IGCHandleManager**,
|
/* Out */ IGCHandleManager**,
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace SVR
|
||||||
extern void PopulateHandleTableDacVars(GcDacVars* dacVars);
|
extern void PopulateHandleTableDacVars(GcDacVars* dacVars);
|
||||||
|
|
||||||
GC_EXPORT
|
GC_EXPORT
|
||||||
void
|
void LOCALGC_CALLCONV
|
||||||
GC_VersionInfo(/* InOut */ VersionInfo* info)
|
GC_VersionInfo(/* InOut */ VersionInfo* info)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_AS_STANDALONE
|
#ifdef BUILD_AS_STANDALONE
|
||||||
|
@ -59,7 +59,7 @@ GC_VersionInfo(/* InOut */ VersionInfo* info)
|
||||||
}
|
}
|
||||||
|
|
||||||
GC_EXPORT
|
GC_EXPORT
|
||||||
HRESULT
|
HRESULT LOCALGC_CALLCONV
|
||||||
GC_Initialize(
|
GC_Initialize(
|
||||||
/* In */ IGCToCLR* clrToGC,
|
/* In */ IGCToCLR* clrToGC,
|
||||||
/* Out */ IGCHeap** gcHeap,
|
/* Out */ IGCHeap** gcHeap,
|
||||||
|
|
|
@ -47,6 +47,12 @@
|
||||||
|
|
||||||
#include "gcdesc.h"
|
#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
|
// The fast paths for object allocation and write barriers is performance critical. They are often
|
||||||
// hand written in assembly code, etc.
|
// hand written in assembly code, etc.
|
||||||
|
@ -106,7 +112,7 @@ void WriteBarrier(Object ** dst, Object * ref)
|
||||||
ErectWriteBarrier(dst, 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[])
|
int __cdecl main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
|
@ -66,8 +66,8 @@ bool GCHeapUtilities::s_useThreadAllocationContexts;
|
||||||
|
|
||||||
// GC entrypoints for the linked-in GC. These symbols are invoked
|
// GC entrypoints for the linked-in GC. These symbols are invoked
|
||||||
// directly if we are not using a standalone GC.
|
// directly if we are not using a standalone GC.
|
||||||
extern "C" void GC_VersionInfo(/* Out */ VersionInfo* info);
|
extern "C" void LOCALGC_CALLCONV GC_VersionInfo(/* Out */ VersionInfo* info);
|
||||||
extern "C" HRESULT GC_Initialize(
|
extern "C" HRESULT LOCALGC_CALLCONV GC_Initialize(
|
||||||
/* In */ IGCToCLR* clrToGC,
|
/* In */ IGCToCLR* clrToGC,
|
||||||
/* Out */ IGCHeap** gcHeap,
|
/* Out */ IGCHeap** gcHeap,
|
||||||
/* Out */ IGCHandleManager** gcHandleManager,
|
/* Out */ IGCHandleManager** gcHandleManager,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue