|
49 | 49 |
|
50 | 50 | #endif // !_MSC_VER |
51 | 51 |
|
| 52 | +// defined in gcrhenv.cpp |
| 53 | +bool __SwitchToThread(uint32_t dwSleepMSec, uint32_t dwSwitchCount); |
| 54 | + |
52 | 55 | #ifndef _INC_WINDOWS |
53 | 56 | //#ifndef DACCESS_COMPILE |
54 | 57 |
|
@@ -101,9 +104,6 @@ typedef struct _GUID { |
101 | 104 |
|
102 | 105 | #define DECLARE_HANDLE(_name) typedef HANDLE _name |
103 | 106 |
|
104 | | -// defined in gcrhenv.cpp |
105 | | -bool __SwitchToThread(uint32_t dwSleepMSec, uint32_t dwSwitchCount); |
106 | | - |
107 | 107 | struct FILETIME |
108 | 108 | { |
109 | 109 | uint32_t dwLowDateTime; |
@@ -602,6 +602,19 @@ extern uint32_t g_RhNumberOfProcessors; |
602 | 602 | #endif // !_INC_WINDOWS |
603 | 603 | #endif // !DACCESS_COMPILE |
604 | 604 |
|
| 605 | +// TODO: Duplicate the definition from PalRedhawkFunctions.h to allow the EventPipe code to |
| 606 | +// access PalEventWrite even though the PalRedhawkFunctions.h services are generally not |
| 607 | +// available in NativeAOT runtime contexts where windows.h has been included. |
| 608 | +#ifdef _INC_WINDOWS |
| 609 | +#ifdef BUILDING_SHARED_NATIVEAOT_EVENTPIPE_CODE |
| 610 | +extern "C" uint32_t __stdcall EventWrite(REGHANDLE, const EVENT_DESCRIPTOR *, uint32_t, EVENT_DATA_DESCRIPTOR *); |
| 611 | +inline uint32_t PalEventWrite(REGHANDLE arg1, const EVENT_DESCRIPTOR * arg2, uint32_t arg3, EVENT_DATA_DESCRIPTOR * arg4) |
| 612 | +{ |
| 613 | + return EventWrite(arg1, arg2, arg3, arg4); |
| 614 | +} |
| 615 | +#endif // BUILDING_SHARED_NATIVEAOT_EVENTPIPE_CODE |
| 616 | +#endif // _INC_WINDOWS |
| 617 | + |
605 | 618 | // The Redhawk PAL must be initialized before any of its exports can be called. Returns true for a successful |
606 | 619 | // initialization and false on failure. |
607 | 620 | REDHAWK_PALIMPORT bool REDHAWK_PALAPI PalInit(); |
@@ -716,6 +729,7 @@ REDHAWK_PALIMPORT void* REDHAWK_PALAPI PalAddVectoredExceptionHandler(uint32_t f |
716 | 729 | typedef uint32_t (__stdcall *BackgroundCallback)(_In_opt_ void* pCallbackContext); |
717 | 730 | REDHAWK_PALIMPORT bool REDHAWK_PALAPI PalStartBackgroundGCThread(_In_ BackgroundCallback callback, _In_opt_ void* pCallbackContext); |
718 | 731 | REDHAWK_PALIMPORT bool REDHAWK_PALAPI PalStartFinalizerThread(_In_ BackgroundCallback callback, _In_opt_ void* pCallbackContext); |
| 732 | +REDHAWK_PALIMPORT bool REDHAWK_PALAPI PalStartEventPipeHelperThread(_In_ BackgroundCallback callback, _In_opt_ void* pCallbackContext); |
719 | 733 |
|
720 | 734 | typedef void (*PalHijackCallback)(_In_ NATIVE_CONTEXT* pThreadContext, _In_opt_ void* pThreadToHijack); |
721 | 735 | REDHAWK_PALIMPORT void REDHAWK_PALAPI PalHijack(HANDLE hThread, _In_opt_ void* pThreadToHijack); |
|
0 commit comments