Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 1 | /* |
Mohammed Nayeem Ur Rahman | 80162f9 | 2019-09-23 19:35:19 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | */ |
| 14 | #ifndef ADSPRPC_SHARED_H |
| 15 | #define ADSPRPC_SHARED_H |
| 16 | |
| 17 | #include <linux/types.h> |
| 18 | |
| 19 | #define FASTRPC_IOCTL_INVOKE _IOWR('R', 1, struct fastrpc_ioctl_invoke) |
| 20 | #define FASTRPC_IOCTL_MMAP _IOWR('R', 2, struct fastrpc_ioctl_mmap) |
| 21 | #define FASTRPC_IOCTL_MUNMAP _IOWR('R', 3, struct fastrpc_ioctl_munmap) |
Tharun Kumar Merugu | 55be90d | 2018-05-31 11:41:03 +0530 | [diff] [blame] | 22 | #define FASTRPC_IOCTL_MMAP_64 _IOWR('R', 14, struct fastrpc_ioctl_mmap_64) |
| 23 | #define FASTRPC_IOCTL_MUNMAP_64 _IOWR('R', 15, struct fastrpc_ioctl_munmap_64) |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 24 | #define FASTRPC_IOCTL_INVOKE_FD _IOWR('R', 4, struct fastrpc_ioctl_invoke_fd) |
| 25 | #define FASTRPC_IOCTL_SETMODE _IOWR('R', 5, uint32_t) |
| 26 | #define FASTRPC_IOCTL_INIT _IOWR('R', 6, struct fastrpc_ioctl_init) |
| 27 | #define FASTRPC_IOCTL_INVOKE_ATTRS \ |
| 28 | _IOWR('R', 7, struct fastrpc_ioctl_invoke_attrs) |
| 29 | #define FASTRPC_IOCTL_GETINFO _IOWR('R', 8, uint32_t) |
Sathish Ambley | a21b5b5 | 2017-01-11 16:11:01 -0800 | [diff] [blame] | 30 | #define FASTRPC_IOCTL_GETPERF _IOWR('R', 9, struct fastrpc_ioctl_perf) |
Sathish Ambley | d6300c3 | 2017-01-18 09:50:43 -0800 | [diff] [blame] | 31 | #define FASTRPC_IOCTL_INIT_ATTRS _IOWR('R', 10, struct fastrpc_ioctl_init_attrs) |
Sathish Ambley | bae5190 | 2017-07-03 15:00:49 -0700 | [diff] [blame] | 32 | #define FASTRPC_IOCTL_INVOKE_CRC _IOWR('R', 11, struct fastrpc_ioctl_invoke_crc) |
Tharun Kumar Merugu | 5f6ca61c | 2017-08-11 11:43:11 +0530 | [diff] [blame] | 33 | #define FASTRPC_IOCTL_CONTROL _IOWR('R', 12, struct fastrpc_ioctl_control) |
c_mtharu | 7bd6a42 | 2017-10-17 18:15:37 +0530 | [diff] [blame] | 34 | #define FASTRPC_IOCTL_MUNMAP_FD _IOWR('R', 13, struct fastrpc_ioctl_munmap_fd) |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 35 | |
| 36 | #define FASTRPC_GLINK_GUID "fastrpcglink-apps-dsp" |
| 37 | #define FASTRPC_SMD_GUID "fastrpcsmd-apps-dsp" |
| 38 | #define DEVICE_NAME "adsprpc-smd" |
Tharun Kumar Merugu | d996b26 | 2018-07-18 22:28:53 +0530 | [diff] [blame] | 39 | #define DEVICE_NAME_SECURE "adsprpc-smd-secure" |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 40 | |
| 41 | /* Set for buffers that have no virtual mapping in userspace */ |
| 42 | #define FASTRPC_ATTR_NOVA 0x1 |
| 43 | |
Tharun Kumar Merugu | 2e5f12e | 2017-07-06 12:04:40 +0530 | [diff] [blame] | 44 | /* Set for buffers that are NOT dma coherent */ |
| 45 | #define FASTRPC_ATTR_NON_COHERENT 0x2 |
| 46 | |
| 47 | /* Set for buffers that are dma coherent */ |
| 48 | #define FASTRPC_ATTR_COHERENT 0x4 |
| 49 | |
c_mtharu | 7bd6a42 | 2017-10-17 18:15:37 +0530 | [diff] [blame] | 50 | /* Fastrpc attribute for keeping the map persistent */ |
| 51 | #define FASTRPC_ATTR_KEEP_MAP 0x8 |
| 52 | |
Tharun Kumar Merugu | 35a94a5 | 2018-02-01 21:09:04 +0530 | [diff] [blame] | 53 | /* Fastrpc attribute for no map */ |
| 54 | #define FASTRPC_ATTR_NOMAP (16) |
| 55 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 56 | /* Driver should operate in parallel with the co-processor */ |
| 57 | #define FASTRPC_MODE_PARALLEL 0 |
| 58 | |
| 59 | /* Driver should operate in serial mode with the co-processor */ |
| 60 | #define FASTRPC_MODE_SERIAL 1 |
| 61 | |
Sathish Ambley | a21b5b5 | 2017-01-11 16:11:01 -0800 | [diff] [blame] | 62 | /* Driver should operate in profile mode with the co-processor */ |
| 63 | #define FASTRPC_MODE_PROFILE 2 |
| 64 | |
Tharun Kumar Merugu | d4d07948 | 2017-09-06 11:22:19 +0530 | [diff] [blame] | 65 | /* Set FastRPC session ID to 1 */ |
| 66 | #define FASTRPC_MODE_SESSION 4 |
| 67 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 68 | /* INIT a new process or attach to guestos */ |
| 69 | #define FASTRPC_INIT_ATTACH 0 |
| 70 | #define FASTRPC_INIT_CREATE 1 |
c_mtharu | e1a5ce1 | 2017-10-13 20:47:09 +0530 | [diff] [blame] | 71 | #define FASTRPC_INIT_CREATE_STATIC 2 |
Tharun Kumar Merugu | 848c095 | 2018-02-07 21:37:19 +0530 | [diff] [blame] | 72 | #define FASTRPC_INIT_ATTACH_SENSORS 3 |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 73 | |
| 74 | /* Retrives number of input buffers from the scalars parameter */ |
| 75 | #define REMOTE_SCALARS_INBUFS(sc) (((sc) >> 16) & 0x0ff) |
| 76 | |
| 77 | /* Retrives number of output buffers from the scalars parameter */ |
| 78 | #define REMOTE_SCALARS_OUTBUFS(sc) (((sc) >> 8) & 0x0ff) |
| 79 | |
| 80 | /* Retrives number of input handles from the scalars parameter */ |
| 81 | #define REMOTE_SCALARS_INHANDLES(sc) (((sc) >> 4) & 0x0f) |
| 82 | |
| 83 | /* Retrives number of output handles from the scalars parameter */ |
| 84 | #define REMOTE_SCALARS_OUTHANDLES(sc) ((sc) & 0x0f) |
| 85 | |
| 86 | #define REMOTE_SCALARS_LENGTH(sc) (REMOTE_SCALARS_INBUFS(sc) +\ |
| 87 | REMOTE_SCALARS_OUTBUFS(sc) +\ |
| 88 | REMOTE_SCALARS_INHANDLES(sc) +\ |
| 89 | REMOTE_SCALARS_OUTHANDLES(sc)) |
| 90 | |
| 91 | #define REMOTE_SCALARS_MAKEX(attr, method, in, out, oin, oout) \ |
| 92 | ((((uint32_t) (attr) & 0x7) << 29) | \ |
| 93 | (((uint32_t) (method) & 0x1f) << 24) | \ |
| 94 | (((uint32_t) (in) & 0xff) << 16) | \ |
| 95 | (((uint32_t) (out) & 0xff) << 8) | \ |
| 96 | (((uint32_t) (oin) & 0x0f) << 4) | \ |
| 97 | ((uint32_t) (oout) & 0x0f)) |
| 98 | |
| 99 | #define REMOTE_SCALARS_MAKE(method, in, out) \ |
| 100 | REMOTE_SCALARS_MAKEX(0, method, in, out, 0, 0) |
| 101 | |
| 102 | |
| 103 | #ifndef VERIFY_PRINT_ERROR |
| 104 | #define VERIFY_EPRINTF(format, args) (void)0 |
| 105 | #endif |
| 106 | |
| 107 | #ifndef VERIFY_PRINT_INFO |
| 108 | #define VERIFY_IPRINTF(args) (void)0 |
| 109 | #endif |
| 110 | |
| 111 | #ifndef VERIFY |
| 112 | #define __STR__(x) #x ":" |
| 113 | #define __TOSTR__(x) __STR__(x) |
| 114 | #define __FILE_LINE__ __FILE__ ":" __TOSTR__(__LINE__) |
| 115 | |
| 116 | #define VERIFY(err, val) \ |
| 117 | do {\ |
| 118 | VERIFY_IPRINTF(__FILE_LINE__"info: calling: " #val "\n");\ |
Tharun Kumar Merugu | e3edf3e | 2017-07-27 12:34:07 +0530 | [diff] [blame] | 119 | if ((val) == 0) {\ |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 120 | (err) = (err) == 0 ? -1 : (err);\ |
| 121 | VERIFY_EPRINTF(__FILE_LINE__"error: %d: " #val "\n", (err));\ |
| 122 | } else {\ |
| 123 | VERIFY_IPRINTF(__FILE_LINE__"info: passed: " #val "\n");\ |
| 124 | } \ |
| 125 | } while (0) |
| 126 | #endif |
| 127 | |
Mohammed Nayeem Ur Rahman | 80162f9 | 2019-09-23 19:35:19 +0530 | [diff] [blame] | 128 | /* Fall back to older APIS in case API is not supported */ |
| 129 | #define AEE_EUNSUPPORTED 20 |
| 130 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 131 | #define remote_arg64_t union remote_arg64 |
| 132 | |
| 133 | struct remote_buf64 { |
| 134 | uint64_t pv; |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 135 | uint64_t len; |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 136 | }; |
| 137 | |
Sathish Ambley | 58dc64d | 2016-11-29 17:11:53 -0800 | [diff] [blame] | 138 | struct remote_dma_handle64 { |
| 139 | int fd; |
| 140 | uint32_t offset; |
| 141 | uint32_t len; |
| 142 | }; |
| 143 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 144 | union remote_arg64 { |
| 145 | struct remote_buf64 buf; |
Sathish Ambley | 58dc64d | 2016-11-29 17:11:53 -0800 | [diff] [blame] | 146 | struct remote_dma_handle64 dma; |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 147 | uint32_t h; |
| 148 | }; |
| 149 | |
| 150 | #define remote_arg_t union remote_arg |
| 151 | |
| 152 | struct remote_buf { |
| 153 | void *pv; /* buffer pointer */ |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 154 | size_t len; /* length of buffer */ |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 155 | }; |
| 156 | |
Sathish Ambley | 58dc64d | 2016-11-29 17:11:53 -0800 | [diff] [blame] | 157 | struct remote_dma_handle { |
| 158 | int fd; |
| 159 | uint32_t offset; |
| 160 | }; |
| 161 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 162 | union remote_arg { |
| 163 | struct remote_buf buf; /* buffer info */ |
Sathish Ambley | 58dc64d | 2016-11-29 17:11:53 -0800 | [diff] [blame] | 164 | struct remote_dma_handle dma; |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 165 | uint32_t h; /* remote handle */ |
| 166 | }; |
| 167 | |
| 168 | struct fastrpc_ioctl_invoke { |
| 169 | uint32_t handle; /* remote handle */ |
| 170 | uint32_t sc; /* scalars describing the data */ |
| 171 | remote_arg_t *pra; /* remote arguments list */ |
| 172 | }; |
| 173 | |
| 174 | struct fastrpc_ioctl_invoke_fd { |
| 175 | struct fastrpc_ioctl_invoke inv; |
| 176 | int *fds; /* fd list */ |
| 177 | }; |
| 178 | |
| 179 | struct fastrpc_ioctl_invoke_attrs { |
| 180 | struct fastrpc_ioctl_invoke inv; |
| 181 | int *fds; /* fd list */ |
| 182 | unsigned int *attrs; /* attribute list */ |
| 183 | }; |
| 184 | |
Sathish Ambley | bae5190 | 2017-07-03 15:00:49 -0700 | [diff] [blame] | 185 | struct fastrpc_ioctl_invoke_crc { |
| 186 | struct fastrpc_ioctl_invoke inv; |
| 187 | int *fds; /* fd list */ |
| 188 | unsigned int *attrs; /* attribute list */ |
| 189 | unsigned int *crc; |
| 190 | }; |
| 191 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 192 | struct fastrpc_ioctl_init { |
| 193 | uint32_t flags; /* one of FASTRPC_INIT_* macros */ |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 194 | uintptr_t file; /* pointer to elf file */ |
| 195 | uint32_t filelen; /* elf file length */ |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 196 | int32_t filefd; /* ION fd for the file */ |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 197 | uintptr_t mem; /* mem for the PD */ |
| 198 | uint32_t memlen; /* mem length */ |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 199 | int32_t memfd; /* ION fd for the mem */ |
| 200 | }; |
| 201 | |
Sathish Ambley | d6300c3 | 2017-01-18 09:50:43 -0800 | [diff] [blame] | 202 | struct fastrpc_ioctl_init_attrs { |
| 203 | struct fastrpc_ioctl_init init; |
| 204 | int attrs; |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 205 | unsigned int siglen; |
Sathish Ambley | d6300c3 | 2017-01-18 09:50:43 -0800 | [diff] [blame] | 206 | }; |
| 207 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 208 | struct fastrpc_ioctl_munmap { |
Tharun Kumar Merugu | 6c7d37d | 2018-04-18 12:14:22 +0530 | [diff] [blame] | 209 | uintptr_t vaddrout; /* address to unmap */ |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 210 | size_t size; /* size */ |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 211 | }; |
| 212 | |
Tharun Kumar Merugu | 55be90d | 2018-05-31 11:41:03 +0530 | [diff] [blame] | 213 | struct fastrpc_ioctl_munmap_64 { |
| 214 | uint64_t vaddrout; /* address to unmap */ |
| 215 | size_t size; /* size */ |
| 216 | }; |
| 217 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 218 | struct fastrpc_ioctl_mmap { |
| 219 | int fd; /* ion fd */ |
| 220 | uint32_t flags; /* flags for dsp to map with */ |
Tharun Kumar Merugu | 6c7d37d | 2018-04-18 12:14:22 +0530 | [diff] [blame] | 221 | uintptr_t vaddrin; /* optional virtual address */ |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 222 | size_t size; /* size */ |
Tharun Kumar Merugu | 6c7d37d | 2018-04-18 12:14:22 +0530 | [diff] [blame] | 223 | uintptr_t vaddrout; /* dsps virtual address */ |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 224 | }; |
| 225 | |
Tharun Kumar Merugu | 55be90d | 2018-05-31 11:41:03 +0530 | [diff] [blame] | 226 | struct fastrpc_ioctl_mmap_64 { |
Tharun Kumar Merugu | e073de7 | 2018-07-30 23:57:47 +0530 | [diff] [blame] | 227 | int fd; /* ion fd */ |
Tharun Kumar Merugu | 55be90d | 2018-05-31 11:41:03 +0530 | [diff] [blame] | 228 | uint32_t flags; /* flags for dsp to map with */ |
| 229 | uint64_t vaddrin; /* optional virtual address */ |
| 230 | size_t size; /* size */ |
| 231 | uint64_t vaddrout; /* dsps virtual address */ |
| 232 | }; |
| 233 | |
c_mtharu | 7bd6a42 | 2017-10-17 18:15:37 +0530 | [diff] [blame] | 234 | struct fastrpc_ioctl_munmap_fd { |
| 235 | int fd; /* fd */ |
| 236 | uint32_t flags; /* control flags */ |
| 237 | uintptr_t va; /* va */ |
| 238 | ssize_t len; /* length */ |
| 239 | }; |
| 240 | |
Sathish Ambley | a21b5b5 | 2017-01-11 16:11:01 -0800 | [diff] [blame] | 241 | struct fastrpc_ioctl_perf { /* kernel performance data */ |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 242 | uintptr_t data; |
Sathish Ambley | a21b5b5 | 2017-01-11 16:11:01 -0800 | [diff] [blame] | 243 | uint32_t numkeys; |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 244 | uintptr_t keys; |
Sathish Ambley | a21b5b5 | 2017-01-11 16:11:01 -0800 | [diff] [blame] | 245 | }; |
| 246 | |
Tharun Kumar Merugu | e073de7 | 2018-07-30 23:57:47 +0530 | [diff] [blame] | 247 | #define FASTRPC_CONTROL_LATENCY (1) |
Tharun Kumar Merugu | 5f6ca61c | 2017-08-11 11:43:11 +0530 | [diff] [blame] | 248 | struct fastrpc_ctrl_latency { |
Tharun Kumar Merugu | e073de7 | 2018-07-30 23:57:47 +0530 | [diff] [blame] | 249 | uint32_t enable; /* latency control enable */ |
| 250 | uint32_t level; /* level of control */ |
Tharun Kumar Merugu | 5f6ca61c | 2017-08-11 11:43:11 +0530 | [diff] [blame] | 251 | }; |
Tharun Kumar Merugu | e073de7 | 2018-07-30 23:57:47 +0530 | [diff] [blame] | 252 | |
| 253 | #define FASTRPC_CONTROL_SMMU (2) |
Tharun Kumar Merugu | 848c095 | 2018-02-07 21:37:19 +0530 | [diff] [blame] | 254 | struct fastrpc_ctrl_smmu { |
| 255 | uint32_t sharedcb; |
| 256 | }; |
Tharun Kumar Merugu | e073de7 | 2018-07-30 23:57:47 +0530 | [diff] [blame] | 257 | |
| 258 | #define FASTRPC_CONTROL_KALLOC (3) |
| 259 | struct fastrpc_ctrl_kalloc { |
| 260 | uint32_t kalloc_support; /* Remote memory allocation from kernel */ |
| 261 | }; |
| 262 | |
Tharun Kumar Merugu | 5f6ca61c | 2017-08-11 11:43:11 +0530 | [diff] [blame] | 263 | struct fastrpc_ioctl_control { |
| 264 | uint32_t req; |
| 265 | union { |
| 266 | struct fastrpc_ctrl_latency lp; |
Tharun Kumar Merugu | 848c095 | 2018-02-07 21:37:19 +0530 | [diff] [blame] | 267 | struct fastrpc_ctrl_smmu smmu; |
Tharun Kumar Merugu | e073de7 | 2018-07-30 23:57:47 +0530 | [diff] [blame] | 268 | struct fastrpc_ctrl_kalloc kalloc; |
Tharun Kumar Merugu | 5f6ca61c | 2017-08-11 11:43:11 +0530 | [diff] [blame] | 269 | }; |
| 270 | }; |
| 271 | |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 272 | struct smq_null_invoke { |
| 273 | uint64_t ctx; /* invoke caller context */ |
| 274 | uint32_t handle; /* handle to invoke */ |
| 275 | uint32_t sc; /* scalars structure describing the data */ |
| 276 | }; |
| 277 | |
| 278 | struct smq_phy_page { |
| 279 | uint64_t addr; /* physical address */ |
| 280 | uint64_t size; /* size of contiguous region */ |
| 281 | }; |
| 282 | |
| 283 | struct smq_invoke_buf { |
| 284 | int num; /* number of contiguous regions */ |
| 285 | int pgidx; /* index to start of contiguous region */ |
| 286 | }; |
| 287 | |
| 288 | struct smq_invoke { |
| 289 | struct smq_null_invoke header; |
| 290 | struct smq_phy_page page; /* remote arg and list of pages address */ |
| 291 | }; |
| 292 | |
| 293 | struct smq_msg { |
| 294 | uint32_t pid; /* process group id */ |
| 295 | uint32_t tid; /* thread id */ |
| 296 | struct smq_invoke invoke; |
| 297 | }; |
| 298 | |
| 299 | struct smq_invoke_rsp { |
| 300 | uint64_t ctx; /* invoke caller context */ |
| 301 | int retval; /* invoke return value */ |
| 302 | }; |
| 303 | |
| 304 | static inline struct smq_invoke_buf *smq_invoke_buf_start(remote_arg64_t *pra, |
| 305 | uint32_t sc) |
| 306 | { |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 307 | unsigned int len = REMOTE_SCALARS_LENGTH(sc); |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 308 | |
| 309 | return (struct smq_invoke_buf *)(&pra[len]); |
| 310 | } |
| 311 | |
| 312 | static inline struct smq_phy_page *smq_phy_page_start(uint32_t sc, |
| 313 | struct smq_invoke_buf *buf) |
| 314 | { |
Tharun Kumar Merugu | fb51f94 | 2017-12-07 10:32:15 +0530 | [diff] [blame] | 315 | unsigned int nTotal = REMOTE_SCALARS_LENGTH(sc); |
Sathish Ambley | 69e1ab0 | 2016-10-18 10:28:15 -0700 | [diff] [blame] | 316 | |
| 317 | return (struct smq_phy_page *)(&buf[nTotal]); |
| 318 | } |
| 319 | |
| 320 | #endif |