blob: 933e39bc2677fa44365aab0bffce352f3cff7a41 [file] [log] [blame]
Martijn Coenencbe590c2016-08-30 11:27:56 -07001/*
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
Hridya Valsaraju3e320032016-08-08 11:12:30 -070017package android.hardware.tests.msgq@1.0;
18
19interface ITestMsgQ {
Hridya Valsaraju710e4a32016-12-15 09:14:13 -080020 enum EventFlagBits : uint32_t {
21 FMQ_NOT_EMPTY = 1 << 0,
22 FMQ_NOT_FULL = 1 << 1,
23 };
24
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070025 /*
Hridya Valsarajub4358452016-10-14 16:48:01 -070026 * This method requests the service to set up a synchronous read/write
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070027 * wait-free FMQ with the client as reader.
Hridya Valsarajub4358452016-10-14 16:48:01 -070028 *
29 * @return ret True if the setup is successful.
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070030 * @return mqDesc This structure describes the FMQ that was
31 * set up by the service. Client can use it to set up the FMQ at its end.
32 */
33 configureFmqSyncReadWrite()
Hridya Valsarajuf70884c2016-12-27 12:40:01 -080034 generates(bool ret, fmq_sync<uint16_t> mqDesc);
Hridya Valsaraju3e320032016-08-08 11:12:30 -070035
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070036 /*
Hridya Valsarajub4358452016-10-14 16:48:01 -070037 * This method requests the service to set up an unsynchronized write
38 * wait-free FMQ with the client as reader.
39 *
40 * @return ret True if the setup is successful.
41 * @return mqDesc This structure describes the FMQ that was
42 * set up by the service. Client can use it to set up the FMQ at its end.
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070043 */
Hridya Valsarajub4358452016-10-14 16:48:01 -070044 configureFmqUnsyncWrite()
Hridya Valsarajuf70884c2016-12-27 12:40:01 -080045 generates(bool ret, fmq_unsync<uint16_t> mqDesc);
Hridya Valsaraju3e320032016-08-08 11:12:30 -070046
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070047 /*
Hridya Valsarajub4358452016-10-14 16:48:01 -070048 * This method request the service to write into the synchronized read/write
49 * flavor of the FMQ.
50 *
51 * @param count Number to messages to write.
52 *
53 * @return ret True if the write operation was successful.
Hridya Valsaraju9d9672c2016-09-21 17:47:06 -070054 */
Hridya Valsarajub4358452016-10-14 16:48:01 -070055 requestWriteFmqSync(int32_t count) generates(bool ret);
56
57 /*
58 * This method request the service to read from the synchronized read/write
59 * FMQ.
60 *
61 * @param count Number to messages to read.
62 *
63 * @return ret True if the read operation was successful.
64 */
65 requestReadFmqSync(int32_t count) generates(bool ret);
66
67 /*
68 * This method request the service to write into the unsynchronized flavor
69 * of FMQ.
70 *
71 * @param count Number to messages to write.
72 *
73 * @return ret True if the write operation was successful.
74 */
75 requestWriteFmqUnsync(int32_t count) generates(bool ret);
76
77 /*
78 * This method request the service to read from the unsynchronized flavor of
79 * FMQ.
80 *
81 * @param count Number to messages to read.
82 *
83 * @return ret Will be True if the read operation was successful.
84 */
85 requestReadFmqUnsync(int32_t count) generates(bool ret);
86
Hridya Valsaraju710e4a32016-12-15 09:14:13 -080087 /*
88 * This method requests the service to trigger a blocking read.
89 *
90 * @param count Number of messages to read.
91 *
92 */
93 oneway requestBlockingRead(int32_t count);
Hridya Valsaraju3e320032016-08-08 11:12:30 -070094};