1 /*
2  * Copyright (C) 2021 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 #include <scs_test_app_consts.h>
18 #include <stdbool.h>
19 #include <trusty_ipc.h>
20 #include <trusty_log.h>
21 
22 #define TLOG_TAG "userscs-test-app"
23 
24 /*
25  * This app doesn't do anything. We simply use it to test the
26  * shadow call stack size from the userscstest kernel app.
27  */
main(void)28 int main(void) {
29     int rc;
30     uevent_t uevt;
31     handle_t handle;
32 
33     rc = port_create(PORT_NAME, 1, 1, IPC_PORT_ALLOW_TA_CONNECT);
34     if (rc < 0) {
35         TLOGE("failed (%d) to create port for userscs test app\n", rc);
36         return rc;
37     }
38     handle = (handle_t)rc;
39 
40     /* wait infinitely long absent any messages */
41     rc = wait(handle, &uevt, INFINITE_TIME);
42 
43     return 1; /* shouldn't get here */
44 }
45