blob: 177d6363ccbf5d6c2d8c4343956b37d83e0b5849 [file] [log] [blame]
David Vinczec140f5f2023-09-07 15:48:25 +02001/*
2 * Copyright (c) 2024, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8/*
9 * Packing scheme of the control parameter
10 *
11 * 31 30-28 27 26-24 23-20 19 18-16 15-0
12 * +------------+-----+------+-------+-----+-------+-------+------+
13 * | | | | invec | | | outvec| type |
14 * | Res | Res | Res | number| Res | Res | number| |
15 * +------------+-----+------+-------+-----+-------+-------+------+
16 *
17 * Res: Reserved.
18 */
19
20#ifndef RSS_COMMS_PROTOCOL_COMMON
21#define RSS_COMMS_PROTOCOL_COMMON
22
23#define TYPE_OFFSET (0U)
24#define TYPE_MASK (0xFFFFUL << TYPE_OFFSET)
25#define IN_LEN_OFFSET (24U)
26#define IN_LEN_MASK (0x7UL << IN_LEN_OFFSET)
27#define OUT_LEN_OFFSET (16U)
28#define OUT_LEN_MASK (0x7UL << OUT_LEN_OFFSET)
29
30#define PARAM_PACK(type, in_len, out_len) \
31 (((((uint32_t)(type)) << TYPE_OFFSET) & TYPE_MASK) | \
32 ((((uint32_t)(in_len)) << IN_LEN_OFFSET) & IN_LEN_MASK) | \
33 ((((uint32_t)(out_len)) << OUT_LEN_OFFSET) & OUT_LEN_MASK))
34
35#endif /* RSS_COMMS_PROTOCOL_COMMON */