Antonio Nino Diaz | 9bf1d23 | 2018-11-08 09:21:48 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef SPRT_COMMON_H |
| 8 | #define SPRT_COMMON_H |
| 9 | |
| 10 | #define SPRT_MAX_MSG_ARGS 6 |
| 11 | |
| 12 | /* |
| 13 | * Message types supported. |
| 14 | */ |
| 15 | #define SPRT_MSG_TYPE_SERVICE_HANDLE_OPEN 1 |
| 16 | #define SPRT_MSG_TYPE_SERVICE_HANDLE_CLOSE 2 |
| 17 | /* TODO: Add other types of SPRT messages. */ |
| 18 | #define SPRT_MSG_TYPE_SERVICE_TUN_REQUEST 10 |
| 19 | |
| 20 | /* |
| 21 | * Struct that defines the layout of the fields corresponding to a request in |
| 22 | * shared memory. |
| 23 | */ |
| 24 | struct __attribute__((__packed__)) sprt_queue_entry_message { |
| 25 | uint32_t type; /* Type of message (result of an SPCI call). */ |
| 26 | uint16_t client_id; /* SPCI client ID */ |
| 27 | uint16_t service_handle;/* SPCI service handle */ |
| 28 | uint32_t session_id; /* Optional SPCI session ID */ |
| 29 | uint32_t token; /* SPCI request token */ |
| 30 | uint64_t args[SPRT_MAX_MSG_ARGS]; |
| 31 | }; |
| 32 | |
| 33 | #define SPRT_QUEUE_ENTRY_MSG_SIZE (sizeof(struct sprt_queue_entry_message)) |
| 34 | |
| 35 | #define SPRT_QUEUE_NUM_BLOCKING 0 |
| 36 | #define SPRT_QUEUE_NUM_NON_BLOCKING 1 |
| 37 | |
| 38 | #endif /* SPRT_COMMON_H */ |