1/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// Don't edit this file!  It is auto-generated by frameworks/rs/api/generate.sh.
18
19/*
20 * rs_io.rsh: Input/Output Functions
21 *
22 * These functions are used to:
23 * - Send information to the Java client, and
24 * - Send the processed allocation or receive the next allocation to process.
25 */
26
27#ifndef RENDERSCRIPT_RS_IO_RSH
28#define RENDERSCRIPT_RS_IO_RSH
29
30/*
31 * rsAllocationIoReceive: Receive new content from the queue
32 *
33 * Receive a new set of contents from the queue.
34 *
35 * This function should not be called from inside a kernel, or from any function
36 * that may be called directly or indirectly from a kernel. Doing so would cause a
37 * runtime error.
38 *
39 * Parameters:
40 *   a: Allocation to work on.
41 */
42#if (defined(RS_VERSION) && (RS_VERSION >= 16))
43extern void __attribute__((overloadable))
44    rsAllocationIoReceive(rs_allocation a);
45#endif
46
47/*
48 * rsAllocationIoSend: Send new content to the queue
49 *
50 * Send the contents of the Allocation to the queue.
51 *
52 * This function should not be called from inside a kernel, or from any function
53 * that may be called directly or indirectly from a kernel. Doing so would cause a
54 * runtime error.
55 *
56 * Parameters:
57 *   a: Allocation to work on.
58 */
59#if (defined(RS_VERSION) && (RS_VERSION >= 16))
60extern void __attribute__((overloadable))
61    rsAllocationIoSend(rs_allocation a);
62#endif
63
64/*
65 * rsSendToClient: Send a message to the client, non-blocking
66 *
67 * Sends a message back to the client.  This call does not block.
68 * It returns true if the message was sent and false if the
69 * message queue is full.
70 *
71 * A message ID is required.  The data payload is optional.
72 *
73 * See RenderScript.RSMessageHandler.
74 *
75 * Parameters:
76 *   data: Application specific data.
77 *   len: Length of the data, in bytes.
78 */
79extern bool __attribute__((overloadable))
80    rsSendToClient(int cmdID);
81
82extern bool __attribute__((overloadable))
83    rsSendToClient(int cmdID, const void* data, uint len);
84
85/*
86 * rsSendToClientBlocking: Send a message to the client, blocking
87 *
88 * Sends a message back to the client.  This function will block
89 * until there is room on the message queue for this message.
90 * This function may return before the message was delivered and
91 * processed by the client.
92 *
93 * A message ID is required.  The data payload is optional.
94 *
95 * See RenderScript.RSMessageHandler.
96 *
97 * Parameters:
98 *   data: Application specific data.
99 *   len: Length of the data, in bytes.
100 */
101extern void __attribute__((overloadable))
102    rsSendToClientBlocking(int cmdID);
103
104extern void __attribute__((overloadable))
105    rsSendToClientBlocking(int cmdID, const void* data, uint len);
106
107#endif // RENDERSCRIPT_RS_IO_RSH
108