1 //===---- OrcRTBridge.h -- Utils for interacting with orc-rt ----*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Declares types and symbol names provided by the ORC runtime. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H 14 #define LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H 15 16 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h" 17 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorSymbolDef.h" 18 #include "llvm/ExecutionEngine/Orc/Shared/SimpleRemoteEPCUtils.h" 19 #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h" 20 #include "llvm/Support/Compiler.h" 21 22 namespace llvm { 23 namespace orc { 24 namespace rt { 25 26 LLVM_ABI extern const char *SimpleExecutorDylibManagerInstanceName; 27 LLVM_ABI extern const char *SimpleExecutorDylibManagerOpenWrapperName; 28 LLVM_ABI extern const char *SimpleExecutorDylibManagerLookupWrapperName; 29 30 LLVM_ABI extern const char *SimpleExecutorMemoryManagerInstanceName; 31 LLVM_ABI extern const char *SimpleExecutorMemoryManagerReserveWrapperName; 32 LLVM_ABI extern const char *SimpleExecutorMemoryManagerFinalizeWrapperName; 33 LLVM_ABI extern const char *SimpleExecutorMemoryManagerDeallocateWrapperName; 34 35 LLVM_ABI extern const char *ExecutorSharedMemoryMapperServiceInstanceName; 36 LLVM_ABI extern const char *ExecutorSharedMemoryMapperServiceReserveWrapperName; 37 LLVM_ABI extern const char 38 *ExecutorSharedMemoryMapperServiceInitializeWrapperName; 39 LLVM_ABI extern const char 40 *ExecutorSharedMemoryMapperServiceDeinitializeWrapperName; 41 LLVM_ABI extern const char *ExecutorSharedMemoryMapperServiceReleaseWrapperName; 42 43 LLVM_ABI extern const char *MemoryWriteUInt8sWrapperName; 44 LLVM_ABI extern const char *MemoryWriteUInt16sWrapperName; 45 LLVM_ABI extern const char *MemoryWriteUInt32sWrapperName; 46 LLVM_ABI extern const char *MemoryWriteUInt64sWrapperName; 47 LLVM_ABI extern const char *MemoryWritePointersWrapperName; 48 LLVM_ABI extern const char *MemoryWriteBuffersWrapperName; 49 50 LLVM_ABI extern const char *MemoryReadUInt8sWrapperName; 51 LLVM_ABI extern const char *MemoryReadUInt16sWrapperName; 52 LLVM_ABI extern const char *MemoryReadUInt32sWrapperName; 53 LLVM_ABI extern const char *MemoryReadUInt64sWrapperName; 54 LLVM_ABI extern const char *MemoryReadPointersWrapperName; 55 LLVM_ABI extern const char *MemoryReadBuffersWrapperName; 56 LLVM_ABI extern const char *MemoryReadStringsWrapperName; 57 58 LLVM_ABI extern const char *RegisterEHFrameSectionAllocActionName; 59 LLVM_ABI extern const char *DeregisterEHFrameSectionAllocActionName; 60 61 LLVM_ABI extern const char *RunAsMainWrapperName; 62 LLVM_ABI extern const char *RunAsVoidFunctionWrapperName; 63 LLVM_ABI extern const char *RunAsIntFunctionWrapperName; 64 65 using SPSSimpleExecutorDylibManagerOpenSignature = 66 shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr, 67 shared::SPSString, uint64_t); 68 69 using SPSSimpleExecutorDylibManagerLookupSignature = 70 shared::SPSExpected<shared::SPSSequence<shared::SPSExecutorSymbolDef>>( 71 shared::SPSExecutorAddr, shared::SPSExecutorAddr, 72 shared::SPSRemoteSymbolLookupSet); 73 74 using SPSSimpleExecutorMemoryManagerReserveSignature = 75 shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr, 76 uint64_t); 77 using SPSSimpleExecutorMemoryManagerFinalizeSignature = 78 shared::SPSError(shared::SPSExecutorAddr, shared::SPSFinalizeRequest); 79 using SPSSimpleExecutorMemoryManagerDeallocateSignature = shared::SPSError( 80 shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>); 81 82 // ExecutorSharedMemoryMapperService 83 using SPSExecutorSharedMemoryMapperServiceReserveSignature = 84 shared::SPSExpected< 85 shared::SPSTuple<shared::SPSExecutorAddr, shared::SPSString>>( 86 shared::SPSExecutorAddr, uint64_t); 87 using SPSExecutorSharedMemoryMapperServiceInitializeSignature = 88 shared::SPSExpected<shared::SPSExecutorAddr>( 89 shared::SPSExecutorAddr, shared::SPSExecutorAddr, 90 shared::SPSSharedMemoryFinalizeRequest); 91 using SPSExecutorSharedMemoryMapperServiceDeinitializeSignature = 92 shared::SPSError(shared::SPSExecutorAddr, 93 shared::SPSSequence<shared::SPSExecutorAddr>); 94 using SPSExecutorSharedMemoryMapperServiceReleaseSignature = shared::SPSError( 95 shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>); 96 97 using SPSRunAsMainSignature = int64_t(shared::SPSExecutorAddr, 98 shared::SPSSequence<shared::SPSString>); 99 using SPSRunAsVoidFunctionSignature = int32_t(shared::SPSExecutorAddr); 100 using SPSRunAsIntFunctionSignature = int32_t(shared::SPSExecutorAddr, int32_t); 101 } // end namespace rt 102 103 namespace rt_alt { 104 LLVM_ABI extern const char *UnwindInfoManagerRegisterActionName; 105 LLVM_ABI extern const char *UnwindInfoManagerDeregisterActionName; 106 } // end namespace rt_alt 107 } // end namespace orc 108 } // end namespace llvm 109 110 #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H 111