| 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 | |
| 25 | #include <cstdint> |
| 26 | |
| 27 | namespace llvm::orc::rt::sps_ci { |
| 28 | |
| 29 | /// Runs a main-like function (int(int argc, char *argv[])) in the executor. |
| 30 | /// Takes the function's address and an argument vector. |
| 31 | struct CallMain { |
| 32 | static constexpr char Name[] = "orc_rt_ci_sps_call_main" ; |
| 33 | using SPSSig = int64_t(shared::SPSExecutorAddr, |
| 34 | shared::SPSSequence<shared::SPSString>); |
| 35 | }; |
| 36 | |
| 37 | /// Runs a void() function in the executor, given its address. |
| 38 | /// WARNING: This operation is experimental and may be removed. |
| 39 | struct CallVoidVoid { |
| 40 | static constexpr char Name[] = "orc_rt_ci_sps_call_void_void" ; |
| 41 | using SPSSig = void(shared::SPSExecutorAddr); |
| 42 | }; |
| 43 | |
| 44 | /// Runs an int32_t() function in the executor, given its address. |
| 45 | /// WARNING: This operation is experimental and may be removed. |
| 46 | struct CallInt32Void { |
| 47 | static constexpr char Name[] = "orc_rt_ci_sps_call_int32_void" ; |
| 48 | using SPSSig = int32_t(shared::SPSExecutorAddr); |
| 49 | }; |
| 50 | |
| 51 | /// Runs an int32_t(int32_t) function in the executor, given its address. |
| 52 | /// WARNING: This operation is experimental and may be removed. |
| 53 | struct CallInt32Int32 { |
| 54 | static constexpr char Name[] = "orc_rt_ci_sps_call_int32_int32" ; |
| 55 | using SPSSig = int32_t(shared::SPSExecutorAddr, int32_t); |
| 56 | }; |
| 57 | |
| 58 | } // namespace llvm::orc::rt::sps_ci |
| 59 | |
| 60 | #endif // LLVM_EXECUTIONENGINE_ORC_SHARED_SPSCI_CALLSPSCI_H |
| 61 | |