| 1 | //===----- CallSPSCI.h - SPS CI for running functions -----------*- 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 | // SPS controller-interface descriptors for running functions in the executor. |
| 10 | // |
| 11 | // Each descriptor names one operation in the runtime's SPS controller |
| 12 | // interface and gives its wire signature. This is the contract between the |
| 13 | // party that implements the operation (the ORC runtime, or LLVM's |
| 14 | // OrcTargetProcess) and the party that calls it (the ORC controller), so it |
| 15 | // must not depend on either side's implementation. |
| 16 | // |
| 17 | //===----------------------------------------------------------------------===// |
| 18 | |
| 19 | #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_SPSCI_CALLSPSCI_H |
| 20 | #define LLVM_EXECUTIONENGINE_ORC_SHARED_SPSCI_CALLSPSCI_H |
| 21 | |
| 22 | #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h" |
| 23 | #include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h" |
| 24 | #include "llvm/ExecutionEngine/Orc/Shared/SymbolNameSpec.h" |
| 25 | |
| 26 | #include <cstdint> |
| 27 | |
| 28 | namespace llvm::orc::rt::sps_ci { |
| 29 | |
| 30 | /// Runs a main-like function (int(int argc, char *argv[])) in the executor. |
| 31 | /// Takes the function's address and an argument vector. |
| 32 | struct CallMain { |
| 33 | static constexpr SymbolNameSpec Name = |
| 34 | SymbolNameSpec::verbatim(Name: "orc_rt_ci_sps_call_main" ); |
| 35 | using SPSSig = int64_t(shared::SPSExecutorAddr, |
| 36 | shared::SPSSequence<shared::SPSString>); |
| 37 | }; |
| 38 | |
| 39 | /// Runs a void() function in the executor, given its address. |
| 40 | /// WARNING: This operation is experimental and may be removed. |
| 41 | struct CallVoidVoid { |
| 42 | static constexpr SymbolNameSpec Name = |
| 43 | SymbolNameSpec::verbatim(Name: "orc_rt_ci_sps_call_void_void" ); |
| 44 | using SPSSig = void(shared::SPSExecutorAddr); |
| 45 | }; |
| 46 | |
| 47 | /// Runs an int32_t() function in the executor, given its address. |
| 48 | /// WARNING: This operation is experimental and may be removed. |
| 49 | struct CallInt32Void { |
| 50 | static constexpr SymbolNameSpec Name = |
| 51 | SymbolNameSpec::verbatim(Name: "orc_rt_ci_sps_call_int32_void" ); |
| 52 | using SPSSig = int32_t(shared::SPSExecutorAddr); |
| 53 | }; |
| 54 | |
| 55 | /// Runs an int32_t(int32_t) function in the executor, given its address. |
| 56 | /// WARNING: This operation is experimental and may be removed. |
| 57 | struct CallInt32Int32 { |
| 58 | static constexpr SymbolNameSpec Name = |
| 59 | SymbolNameSpec::verbatim(Name: "orc_rt_ci_sps_call_int32_int32" ); |
| 60 | using SPSSig = int32_t(shared::SPSExecutorAddr, int32_t); |
| 61 | }; |
| 62 | |
| 63 | } // namespace llvm::orc::rt::sps_ci |
| 64 | |
| 65 | #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_SPSCI_CALLSPSCI_H |
| 66 | |