[libc-commits] [libc] [libc] Export the RPC interface from `libc` (PR #71432)

via libc-commits libc-commits at lists.llvm.org
Mon Nov 6 14:06:30 PST 2023


================
@@ -1,15 +1,41 @@
+def RPCPortT : NamedType<"rpc_port_t">;
+def RPCPortPtrT : PtrType<RPCPortT>;
+def RPCBufferT : NamedType<"rpc_buffer_t">;
+def RPCBufferPtrT : PtrType<RPCBufferT>;
+def RPCCallbackT : NamedType<"rpc_callback_t">;
+
 def GPUExtensions : StandardSpec<"GPUExtensions"> {
   HeaderSpec RPC = HeaderSpec<
     "gpu/rpc.h",
     [], // Macros
-    [], // Types
+    [RPCPortT, RPCBufferT,  RPCCallbackT, SizeTType], // Types
     [], // Enumerations
     [
         FunctionSpec<
             "rpc_host_call",
             RetValSpec<VoidType>,
             [ArgSpec<VoidPtr>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
         >,
+        FunctionSpec<
+            "rpc_open_port",
+            RetValSpec<RPCPortT>,
+            [ArgSpec<UnsignedIntType>]
+        >,
+        FunctionSpec<
+            "rpc_send",
+            RetValSpec<VoidType>,
----------------
michaelrj-google wrote:

design question: Would it make sense to give send, recv, and close return values of some sort? Probably an int so it can return various error codes or 0 on success to match other libc functions.

https://github.com/llvm/llvm-project/pull/71432


More information about the libc-commits mailing list