xref: /aosp_15_r20/external/llvm-libc/src/__support/RPC/rpc_client.h (revision 71db0c75aadcf003ffe3238005f61d7618a3fead)
1 //===-- Shared memory RPC client instantiation ------------------*- 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 #ifndef LLVM_LIBC_SRC___SUPPORT_RPC_RPC_CLIENT_H
10 #define LLVM_LIBC_SRC___SUPPORT_RPC_RPC_CLIENT_H
11 
12 #include "shared/rpc.h"
13 #include "shared/rpc_opcodes.h"
14 
15 #include "src/__support/CPP/type_traits.h"
16 #include "src/__support/macros/config.h"
17 
18 namespace LIBC_NAMESPACE_DECL {
19 namespace rpc {
20 
21 using ::rpc::Buffer;
22 using ::rpc::Client;
23 using ::rpc::Port;
24 using ::rpc::Process;
25 using ::rpc::Server;
26 
27 static_assert(cpp::is_trivially_copyable<Client>::value &&
28                   sizeof(Process<true>) == sizeof(Process<false>),
29               "The client is not trivially copyable from the server");
30 
31 /// The libc client instance used to communicate with the server.
32 [[gnu::visibility("protected")]] extern Client client asm("__llvm_rpc_client");
33 
34 } // namespace rpc
35 } // namespace LIBC_NAMESPACE_DECL
36 
37 #endif
38