LLVM 24.0.0git
SimpleMemoryMap.h
Go to the documentation of this file.
1//===- SimpleMemoryMap.h - Memory-map bindings ------------------*- 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// A controller-side handle to an executor-side memory manager implementing the
10// simple memory-map interface -- reserve, initialize, deinitialize, release --
11// plus the address of the manager instance those calls operate on.
12//
13// Utilities that drive such a manager share this handle:
14// EPCGenericJITLinkMemoryManager and SimpleRemoteMemoryMapper both hold one, so
15// the operations are described once rather than per client.
16//
17// This header is protocol-agnostic, and says nothing about which executor-side
18// implementation is on the other end. See SimpleMemoryMapSPS.h to bind a handle
19// over the ORC runtime's SPS controller interface; that resolves the runtime's
20// SimpleNativeMemoryMap by default, but any implementation exporting the same
21// operations can be bound by resolving them under its own names.
22//
23//===----------------------------------------------------------------------===//
24
25#ifndef LLVM_EXECUTIONENGINE_ORC_SIMPLEMEMORYMAP_H
26#define LLVM_EXECUTIONENGINE_ORC_SIMPLEMEMORYMAP_H
27
30
31#include <cstdint>
32
33namespace llvm::orc {
34
35/// The resolved controller-side handle to an executor-side memory manager: the
36/// address of the manager instance, which is passed as the first argument to
37/// each call, plus the proxies for its operations.
38///
39/// These are protocol-agnostic: sps::createSimpleMemoryMapBindings populates
40/// them over the runtime's SPS controller interface, but a client targeting a
41/// different protocol -- or a different executor-side implementation of these
42/// operations -- can build its own and pass them to the utility that will use
43/// them.
45 /// Reserve an address range of the given size; returns its base.
47
48 /// Apply a finalize request; returns a key for the initialized allocation.
51
52 /// Deinitialize the allocations with the given keys (running their
53 /// deallocation actions) without releasing their memory.
55
56 /// Release the reservations with the given base addresses.
58
64};
65
66} // namespace llvm::orc
67
68#endif // LLVM_EXECUTIONENGINE_ORC_SIMPLEMEMORYMAP_H
unsigned uint64_t
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
Represents an address in the executor process.
The resolved controller-side handle to an executor-side memory manager: the address of the manager in...
Proxy< Expected< ExecutorAddr >(ExecutorAddr, uint64_t)> ReserveProxy
Reserve an address range of the given size; returns its base.
Proxy< Error(ExecutorAddr, ArrayRef< ExecutorAddr >)> DeinitializeProxy
Deinitialize the allocations with the given keys (running their deallocation actions) without releasi...
Proxy< Error(ExecutorAddr, ArrayRef< ExecutorAddr >)> ReleaseProxy
Release the reservations with the given base addresses.
Proxy< Expected< ExecutorAddr >(ExecutorAddr, tpctypes::FinalizeRequest)> InitializeProxy
Apply a finalize request; returns a key for the initialized allocation.