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/SimpleRemoteEPCUtils.h" 18 #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h" 19 20 namespace llvm { 21 namespace orc { 22 namespace rt { 23 24 extern const char *SimpleExecutorDylibManagerInstanceName; 25 extern const char *SimpleExecutorDylibManagerOpenWrapperName; 26 extern const char *SimpleExecutorDylibManagerLookupWrapperName; 27 28 extern const char *SimpleExecutorMemoryManagerInstanceName; 29 extern const char *SimpleExecutorMemoryManagerReserveWrapperName; 30 extern const char *SimpleExecutorMemoryManagerFinalizeWrapperName; 31 extern const char *SimpleExecutorMemoryManagerDeallocateWrapperName; 32 33 extern const char *ExecutorSharedMemoryMapperServiceInstanceName; 34 extern const char *ExecutorSharedMemoryMapperServiceReserveWrapperName; 35 extern const char *ExecutorSharedMemoryMapperServiceInitializeWrapperName; 36 extern const char *ExecutorSharedMemoryMapperServiceDeinitializeWrapperName; 37 extern const char *ExecutorSharedMemoryMapperServiceReleaseWrapperName; 38 39 extern const char *MemoryWriteUInt8sWrapperName; 40 extern const char *MemoryWriteUInt16sWrapperName; 41 extern const char *MemoryWriteUInt32sWrapperName; 42 extern const char *MemoryWriteUInt64sWrapperName; 43 extern const char *MemoryWriteBuffersWrapperName; 44 45 extern const char *RegisterEHFrameSectionWrapperName; 46 extern const char *DeregisterEHFrameSectionWrapperName; 47 48 extern const char *RunAsMainWrapperName; 49 extern const char *RunAsVoidFunctionWrapperName; 50 extern const char *RunAsIntFunctionWrapperName; 51 52 using SPSSimpleExecutorDylibManagerOpenSignature = 53 shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr, 54 shared::SPSString, uint64_t); 55 56 using SPSSimpleExecutorDylibManagerLookupSignature = 57 shared::SPSExpected<shared::SPSSequence<shared::SPSExecutorAddr>>( 58 shared::SPSExecutorAddr, shared::SPSExecutorAddr, 59 shared::SPSRemoteSymbolLookupSet); 60 61 using SPSSimpleExecutorMemoryManagerReserveSignature = 62 shared::SPSExpected<shared::SPSExecutorAddr>(shared::SPSExecutorAddr, 63 uint64_t); 64 using SPSSimpleExecutorMemoryManagerFinalizeSignature = 65 shared::SPSError(shared::SPSExecutorAddr, shared::SPSFinalizeRequest); 66 using SPSSimpleExecutorMemoryManagerDeallocateSignature = shared::SPSError( 67 shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>); 68 69 // ExecutorSharedMemoryMapperService 70 using SPSExecutorSharedMemoryMapperServiceReserveSignature = 71 shared::SPSExpected< 72 shared::SPSTuple<shared::SPSExecutorAddr, shared::SPSString>>( 73 shared::SPSExecutorAddr, uint64_t); 74 using SPSExecutorSharedMemoryMapperServiceInitializeSignature = 75 shared::SPSExpected<shared::SPSExecutorAddr>( 76 shared::SPSExecutorAddr, shared::SPSExecutorAddr, 77 shared::SPSSharedMemoryFinalizeRequest); 78 using SPSExecutorSharedMemoryMapperServiceDeinitializeSignature = 79 shared::SPSError(shared::SPSExecutorAddr, 80 shared::SPSSequence<shared::SPSExecutorAddr>); 81 using SPSExecutorSharedMemoryMapperServiceReleaseSignature = shared::SPSError( 82 shared::SPSExecutorAddr, shared::SPSSequence<shared::SPSExecutorAddr>); 83 84 using SPSRunAsMainSignature = int64_t(shared::SPSExecutorAddr, 85 shared::SPSSequence<shared::SPSString>); 86 using SPSRunAsVoidFunctionSignature = int32_t(shared::SPSExecutorAddr); 87 using SPSRunAsIntFunctionSignature = int32_t(shared::SPSExecutorAddr, int32_t); 88 } // end namespace rt 89 } // end namespace orc 90 } // end namespace llvm 91 92 #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_ORCRTBRIDGE_H 93