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