1 #ifndef _ADSP_CURRENT_PROCESS1_STUB_H
2 #define _ADSP_CURRENT_PROCESS1_STUB_H
3 /*
4 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following
13 * disclaimer in the documentation and/or other materials provided
14 * with the distribution.
15 * * Neither the name of The Linux Foundation nor the names of its
16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
26 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
29 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31 #include "adsp_current_process1.h"
32 #ifndef _QAIC_ENV_H
33 #define _QAIC_ENV_H
34
35 #ifdef __GNUC__
36 #ifdef __clang__
37 #pragma GCC diagnostic ignored "-Wunknown-pragmas"
38 #else
39 #pragma GCC diagnostic ignored "-Wpragmas"
40 #endif
41 #pragma GCC diagnostic ignored "-Wuninitialized"
42 #pragma GCC diagnostic ignored "-Wunused-parameter"
43 #pragma GCC diagnostic ignored "-Wunused-function"
44 #endif
45
46 #ifndef _ATTRIBUTE_UNUSED
47
48 #ifdef _WIN32
49 #define _ATTRIBUTE_UNUSED
50 #else
51 #define _ATTRIBUTE_UNUSED __attribute__ ((unused))
52 #endif
53
54 #endif // _ATTRIBUTE_UNUSED
55
56 #ifndef __QAIC_REMOTE
57 #define __QAIC_REMOTE(ff) ff
58 #endif //__QAIC_REMOTE
59
60 #ifndef __QAIC_HEADER
61 #define __QAIC_HEADER(ff) ff
62 #endif //__QAIC_HEADER
63
64 #ifndef __QAIC_HEADER_EXPORT
65 #define __QAIC_HEADER_EXPORT
66 #endif // __QAIC_HEADER_EXPORT
67
68 #ifndef __QAIC_HEADER_ATTRIBUTE
69 #define __QAIC_HEADER_ATTRIBUTE
70 #endif // __QAIC_HEADER_ATTRIBUTE
71
72 #ifndef __QAIC_IMPL
73 #define __QAIC_IMPL(ff) ff
74 #endif //__QAIC_IMPL
75
76 #ifndef __QAIC_IMPL_EXPORT
77 #define __QAIC_IMPL_EXPORT
78 #endif // __QAIC_IMPL_EXPORT
79
80 #ifndef __QAIC_IMPL_ATTRIBUTE
81 #define __QAIC_IMPL_ATTRIBUTE
82 #endif // __QAIC_IMPL_ATTRIBUTE
83
84 #ifndef __QAIC_STUB
85 #define __QAIC_STUB(ff) ff
86 #endif //__QAIC_STUB
87
88 #ifndef __QAIC_STUB_EXPORT
89 #define __QAIC_STUB_EXPORT
90 #endif // __QAIC_STUB_EXPORT
91
92 #ifndef __QAIC_STUB_ATTRIBUTE
93 #define __QAIC_STUB_ATTRIBUTE
94 #endif // __QAIC_STUB_ATTRIBUTE
95
96 #ifndef __QAIC_SKEL
97 #define __QAIC_SKEL(ff) ff
98 #endif //__QAIC_SKEL__
99
100 #ifndef __QAIC_SKEL_EXPORT
101 #define __QAIC_SKEL_EXPORT
102 #endif // __QAIC_SKEL_EXPORT
103
104 #ifndef __QAIC_SKEL_ATTRIBUTE
105 #define __QAIC_SKEL_ATTRIBUTE
106 #endif // __QAIC_SKEL_ATTRIBUTE
107
108 #ifdef __QAIC_DEBUG__
109 #ifndef __QAIC_DBG_PRINTF__
110 #include <stdio.h>
111 #define __QAIC_DBG_PRINTF__( ee ) do { printf ee ; } while(0)
112 #endif
113 #else
114 #define __QAIC_DBG_PRINTF__( ee ) (void)0
115 #endif
116
117
118 #define _OFFSET(src, sof) ((void*)(((char*)(src)) + (sof)))
119
120 #define _COPY(dst, dof, src, sof, sz) \
121 do {\
122 struct __copy { \
123 char ar[sz]; \
124 };\
125 *(struct __copy*)_OFFSET(dst, dof) = *(struct __copy*)_OFFSET(src, sof);\
126 } while (0)
127
128 #define _COPYIF(dst, dof, src, sof, sz) \
129 do {\
130 if(_OFFSET(dst, dof) != _OFFSET(src, sof)) {\
131 _COPY(dst, dof, src, sof, sz); \
132 } \
133 } while (0)
134
135 _ATTRIBUTE_UNUSED
_qaic_memmove(void * dst,void * src,int size)136 static __inline void _qaic_memmove(void* dst, void* src, int size) {
137 int i;
138 for(i = 0; i < size; ++i) {
139 ((char*)dst)[i] = ((char*)src)[i];
140 }
141 }
142
143 #define _MEMMOVEIF(dst, src, sz) \
144 do {\
145 if(dst != src) {\
146 _qaic_memmove(dst, src, sz);\
147 } \
148 } while (0)
149
150
151 #define _ASSIGN(dst, src, sof) \
152 do {\
153 dst = OFFSET(src, sof); \
154 } while (0)
155
156 #define _STD_STRLEN_IF(str) (str == 0 ? 0 : strlen(str))
157
158 #include "AEEStdErr.h"
159
160 #define _TRY(ee, func) \
161 do { \
162 if (AEE_SUCCESS != ((ee) = func)) {\
163 __QAIC_DBG_PRINTF__((__FILE__ ":%d:error:%d:%s\n", __LINE__, (int)(ee),#func));\
164 goto ee##bail;\
165 } \
166 } while (0)
167
168 #define _CATCH(exception) exception##bail: if (exception != AEE_SUCCESS)
169
170 #define _ASSERT(nErr, ff) _TRY(nErr, 0 == (ff) ? AEE_EBADPARM : AEE_SUCCESS)
171
172 #ifdef __QAIC_DEBUG__
173 #define _ALLOCATE(nErr, pal, size, alignment, pv) _TRY(nErr, _allocator_alloc(pal, __FILE_LINE__, size, alignment, (void**)&pv))
174 #else
175 #define _ALLOCATE(nErr, pal, size, alignment, pv) _TRY(nErr, _allocator_alloc(pal, 0, size, alignment, (void**)&pv))
176 #endif
177
178
179 #endif // _QAIC_ENV_H
180
181 #include "remote.h"
182 #include <string.h>
183 #ifndef _ALLOCATOR_H
184 #define _ALLOCATOR_H
185
186 #include <stdlib.h>
187 #include <stdint.h>
188
189 typedef struct _heap _heap;
190 struct _heap {
191 _heap* pPrev;
192 const char* loc;
193 uint64_t buf;
194 };
195
196 typedef struct _allocator {
197 _heap* pheap;
198 uint8_t* stack;
199 uint8_t* stackEnd;
200 int nSize;
201 } _allocator;
202
203 _ATTRIBUTE_UNUSED
_heap_alloc(_heap ** ppa,const char * loc,int size,void ** ppbuf)204 static __inline int _heap_alloc(_heap** ppa, const char* loc, int size, void** ppbuf) {
205 _heap* pn = 0;
206 pn = malloc(size + sizeof(_heap) - sizeof(uint64_t));
207 if(pn != 0) {
208 pn->pPrev = *ppa;
209 pn->loc = loc;
210 *ppa = pn;
211 *ppbuf = (void*)&(pn->buf);
212 return 0;
213 } else {
214 return -1;
215 }
216 }
217 #define _ALIGN_SIZE(x, y) (((x) + (y-1)) & ~(y-1))
218
219 _ATTRIBUTE_UNUSED
_allocator_alloc(_allocator * me,const char * loc,int size,unsigned int al,void ** ppbuf)220 static __inline int _allocator_alloc(_allocator* me,
221 const char* loc,
222 int size,
223 unsigned int al,
224 void** ppbuf) {
225 if(size < 0) {
226 return -1;
227 } else if (size == 0) {
228 *ppbuf = 0;
229 return 0;
230 }
231 if((_ALIGN_SIZE((uintptr_t)me->stackEnd, al) + size) < (uintptr_t)me->stack + me->nSize) {
232 *ppbuf = (uint8_t*)_ALIGN_SIZE((uintptr_t)me->stackEnd, al);
233 me->stackEnd = (uint8_t*)_ALIGN_SIZE((uintptr_t)me->stackEnd, al) + size;
234 return 0;
235 } else {
236 return _heap_alloc(&me->pheap, loc, size, ppbuf);
237 }
238 }
239
240 _ATTRIBUTE_UNUSED
_allocator_deinit(_allocator * me)241 static __inline void _allocator_deinit(_allocator* me) {
242 _heap* pa = me->pheap;
243 while(pa != 0) {
244 _heap* pn = pa;
245 const char* loc = pn->loc;
246 (void)loc;
247 pa = pn->pPrev;
248 free(pn);
249 }
250 }
251
252 _ATTRIBUTE_UNUSED
_allocator_init(_allocator * me,uint8_t * stack,int stackSize)253 static __inline void _allocator_init(_allocator* me, uint8_t* stack, int stackSize) {
254 me->stack = stack;
255 me->stackEnd = stack + stackSize;
256 me->nSize = stackSize;
257 me->pheap = 0;
258 }
259
260
261 #endif // _ALLOCATOR_H
262
263 #ifndef SLIM_H
264 #define SLIM_H
265
266 #include <stdint.h>
267
268 //a C data structure for the idl types that can be used to implement
269 //static and dynamic language bindings fairly efficiently.
270 //
271 //the goal is to have a minimal ROM and RAM footprint and without
272 //doing too many allocations. A good way to package these things seemed
273 //like the module boundary, so all the idls within one module can share
274 //all the type references.
275
276
277 #define PARAMETER_IN 0x0
278 #define PARAMETER_OUT 0x1
279 #define PARAMETER_INOUT 0x2
280 #define PARAMETER_ROUT 0x3
281 #define PARAMETER_INROUT 0x4
282
283 //the types that we get from idl
284 #define TYPE_OBJECT 0x0
285 #define TYPE_INTERFACE 0x1
286 #define TYPE_PRIMITIVE 0x2
287 #define TYPE_ENUM 0x3
288 #define TYPE_STRING 0x4
289 #define TYPE_WSTRING 0x5
290 #define TYPE_STRUCTURE 0x6
291 #define TYPE_UNION 0x7
292 #define TYPE_ARRAY 0x8
293 #define TYPE_SEQUENCE 0x9
294
295 //these require the pack/unpack to recurse
296 //so it's a hint to those languages that can optimize in cases where
297 //recursion isn't necessary.
298 #define TYPE_COMPLEX_STRUCTURE (0x10 | TYPE_STRUCTURE)
299 #define TYPE_COMPLEX_UNION (0x10 | TYPE_UNION)
300 #define TYPE_COMPLEX_ARRAY (0x10 | TYPE_ARRAY)
301 #define TYPE_COMPLEX_SEQUENCE (0x10 | TYPE_SEQUENCE)
302
303
304 typedef struct Type Type;
305
306 #define INHERIT_TYPE\
307 int32_t nativeSize; /*in the simple case its the same as wire size and alignment*/\
308 union {\
309 struct {\
310 const uintptr_t p1;\
311 const uintptr_t p2;\
312 } _cast;\
313 struct {\
314 uint32_t iid;\
315 uint32_t bNotNil;\
316 } object;\
317 struct {\
318 const Type *arrayType;\
319 int32_t nItems;\
320 } array;\
321 struct {\
322 const Type *seqType;\
323 int32_t nMaxLen;\
324 } seqSimple; \
325 struct {\
326 uint32_t bFloating;\
327 uint32_t bSigned;\
328 } prim; \
329 const SequenceType* seqComplex;\
330 const UnionType *unionType;\
331 const StructType *structType;\
332 int32_t stringMaxLen;\
333 uint8_t bInterfaceNotNil;\
334 } param;\
335 uint8_t type;\
336 uint8_t nativeAlignment\
337
338 typedef struct UnionType UnionType;
339 typedef struct StructType StructType;
340 typedef struct SequenceType SequenceType;
341 struct Type {
342 INHERIT_TYPE;
343 };
344
345 struct SequenceType {
346 const Type * seqType;
347 uint32_t nMaxLen;
348 uint32_t inSize;
349 uint32_t routSizePrimIn;
350 uint32_t routSizePrimROut;
351 };
352
353 //byte offset from the start of the case values for
354 //this unions case value array. it MUST be aligned
355 //at the alignment requrements for the descriptor
356 //
357 //if negative it means that the unions cases are
358 //simple enumerators, so the value read from the descriptor
359 //can be used directly to find the correct case
360 typedef union CaseValuePtr CaseValuePtr;
361 union CaseValuePtr {
362 const uint8_t* value8s;
363 const uint16_t* value16s;
364 const uint32_t* value32s;
365 const uint64_t* value64s;
366 };
367
368 //these are only used in complex cases
369 //so I pulled them out of the type definition as references to make
370 //the type smaller
371 struct UnionType {
372 const Type *descriptor;
373 uint32_t nCases;
374 const CaseValuePtr caseValues;
375 const Type * const *cases;
376 int32_t inSize;
377 int32_t routSizePrimIn;
378 int32_t routSizePrimROut;
379 uint8_t inAlignment;
380 uint8_t routAlignmentPrimIn;
381 uint8_t routAlignmentPrimROut;
382 uint8_t inCaseAlignment;
383 uint8_t routCaseAlignmentPrimIn;
384 uint8_t routCaseAlignmentPrimROut;
385 uint8_t nativeCaseAlignment;
386 uint8_t bDefaultCase;
387 };
388
389 struct StructType {
390 uint32_t nMembers;
391 const Type * const *members;
392 int32_t inSize;
393 int32_t routSizePrimIn;
394 int32_t routSizePrimROut;
395 uint8_t inAlignment;
396 uint8_t routAlignmentPrimIn;
397 uint8_t routAlignmentPrimROut;
398 };
399
400 typedef struct Parameter Parameter;
401 struct Parameter {
402 INHERIT_TYPE;
403 uint8_t mode;
404 uint8_t bNotNil;
405 };
406
407 #define SLIM_IFPTR32(is32,is64) (sizeof(uintptr_t) == 4 ? (is32) : (is64))
408 #define SLIM_SCALARS_IS_DYNAMIC(u) (((u) & 0x00ffffff) == 0x00ffffff)
409
410 typedef struct Method Method;
411 struct Method {
412 uint32_t uScalars; //no method index
413 int32_t primInSize;
414 int32_t primROutSize;
415 int maxArgs;
416 int numParams;
417 const Parameter * const *params;
418 uint8_t primInAlignment;
419 uint8_t primROutAlignment;
420 };
421
422 typedef struct Interface Interface;
423
424 struct Interface {
425 int nMethods;
426 const Method * const *methodArray;
427 int nIIds;
428 const uint32_t *iids;
429 const uint16_t* methodStringArray;
430 const uint16_t* methodStrings;
431 const char* strings;
432 };
433
434
435 #endif //SLIM_H
436
437
438 #ifndef _ADSP_CURRENT_PROCESS1_SLIM_H
439 #define _ADSP_CURRENT_PROCESS1_SLIM_H
440 #include "remote.h"
441 #include <stdint.h>
442
443 #ifndef __QAIC_SLIM
444 #define __QAIC_SLIM(ff) ff
445 #endif
446 #ifndef __QAIC_SLIM_EXPORT
447 #define __QAIC_SLIM_EXPORT
448 #endif
449
450 static const Type types[1];
451 static const SequenceType sequenceTypes[1] = {{&(types[0]),0x0,0x4,0x4,0x0}};
452 static const Type types[1] = {{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)0x0,0}}, 4,SLIM_IFPTR32(0x4,0x8)}};
453 static const Parameter parameters[6] = {{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)0x0,0}}, 4,SLIM_IFPTR32(0x4,0x8),0,0},{SLIM_IFPTR32(0x4,0x8),{{(const uintptr_t)0xdeadc0de,(const uintptr_t)0}}, 0,SLIM_IFPTR32(0x4,0x8),3,0},{SLIM_IFPTR32(0x4,0x8),{{(const uintptr_t)0xdeadc0de,(const uintptr_t)0}}, 0,SLIM_IFPTR32(0x4,0x8),0,0},{0x2,{{(const uintptr_t)0,(const uintptr_t)0}}, 2,0x2,0,0},{SLIM_IFPTR32(0x8,0x10),{{(const uintptr_t)&(sequenceTypes[0]),0}}, 25,SLIM_IFPTR32(0x4,0x8),0,0},{0x4,{{(const uintptr_t)0,(const uintptr_t)0}}, 2,0x4,3,0}};
454 static const Parameter* const parameterArrays[6] = {(&(parameters[3])),(&(parameters[4])),(&(parameters[0])),(&(parameters[1])),(&(parameters[5])),(&(parameters[2]))};
455 static const Method methods[5] = {{REMOTE_SCALARS_MAKEX(0,0,0x2,0x0,0x0,0x1),0x4,0x0,2,2,(&(parameterArrays[2])),0x4,0x1},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x0,0x1,0x0),0x0,0x0,1,1,(&(parameterArrays[5])),0x1,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x0,0x0,0x0),0x0,0x0,0,0,0,0x0,0x0},{REMOTE_SCALARS_MAKEX(0,0,255,255,15,15),0x8,0x0,3,2,(&(parameterArrays[0])),0x4,0x0},{REMOTE_SCALARS_MAKEX(0,0,0x0,0x1,0x0,0x0),0x0,0x4,1,1,(&(parameterArrays[4])),0x1,0x4}};
456 static const Method* const methodArrays[6] = {&(methods[0]),&(methods[1]),&(methods[2]),&(methods[2]),&(methods[3]),&(methods[4])};
457 static const char strings[77] = "set_logging_params\0thread_exit\0filesToLog\0getASID\0close\0asid\0mask\0open\0uri\0h\0";
458 static const uint16_t methodStrings[12] = {0,61,31,66,71,75,42,56,50,75,19,26};
459 static const uint16_t methodStringsArrays[6] = {3,8,11,10,0,6};
460 __QAIC_SLIM_EXPORT const Interface __QAIC_SLIM(adsp_current_process1_slim) = {6,&(methodArrays[0]),0,0,&(methodStringsArrays [0]),methodStrings,strings};
461 #endif //_ADSP_CURRENT_PROCESS1_SLIM_H
__QAIC_STUB(adsp_current_process1_skel_handle_invoke)462 __QAIC_STUB_EXPORT int __QAIC_STUB(adsp_current_process1_skel_handle_invoke)(remote_handle64 _h, uint32_t _sc, remote_arg* _pra) __QAIC_STUB_ATTRIBUTE {
463 return __QAIC_REMOTE(remote_handle64_invoke)(_h, _sc, _pra);
464 }
465 #ifdef __cplusplus
466 extern "C" {
467 #endif
__QAIC_STUB(adsp_current_process1_open)468 __QAIC_STUB_EXPORT int __QAIC_STUB(adsp_current_process1_open)(const char* uri, remote_handle64* h) __QAIC_STUB_ATTRIBUTE {
469 return __QAIC_REMOTE(remote_handle64_open)(uri, h);
470 }
__QAIC_STUB(adsp_current_process1_close)471 __QAIC_STUB_EXPORT int __QAIC_STUB(adsp_current_process1_close)(remote_handle64 h) __QAIC_STUB_ATTRIBUTE {
472 return __QAIC_REMOTE(remote_handle64_close)(h);
473 }
_stub_method(remote_handle64 _handle,uint32_t _mid)474 static __inline int _stub_method(remote_handle64 _handle, uint32_t _mid) {
475 remote_arg* _pra = 0;
476 int _nErr = 0;
477 _TRY(_nErr, __QAIC_REMOTE(remote_handle64_invoke)(_handle, REMOTE_SCALARS_MAKEX(0, _mid, 0, 0, 0, 0), _pra));
478 _CATCH(_nErr) {}
479 return _nErr;
480 }
__QAIC_STUB(adsp_current_process1_exit)481 __QAIC_STUB_EXPORT int __QAIC_STUB(adsp_current_process1_exit)(remote_handle64 _handle) __QAIC_STUB_ATTRIBUTE {
482 uint32_t _mid = 2;
483 return _stub_method(_handle, _mid);
484 }
__QAIC_STUB(adsp_current_process1_thread_exit)485 __QAIC_STUB_EXPORT int __QAIC_STUB(adsp_current_process1_thread_exit)(remote_handle64 _handle) __QAIC_STUB_ATTRIBUTE {
486 uint32_t _mid = 3;
487 return _stub_method(_handle, _mid);
488 }
_stub_unpack(remote_arg * _praROutPost,remote_arg * _ppraROutPost[1],void * _primROut,char * _in0[1],uint32_t _in0Len[1])489 static __inline int _stub_unpack(remote_arg* _praROutPost, remote_arg* _ppraROutPost[1], void* _primROut, char* _in0[1], uint32_t _in0Len[1]) {
490 int _nErr = 0;
491 remote_arg* _praROutPostStart = _praROutPost;
492 remote_arg** _ppraROutPostStart = _ppraROutPost;
493 _ppraROutPost = &_praROutPost;
494 _ppraROutPostStart[0] += (_praROutPost - _praROutPostStart) +0;
495 return _nErr;
496 }
_stub_pack(_allocator * _al,remote_arg * _praIn,remote_arg * _ppraIn[1],remote_arg * _praROut,remote_arg * _ppraROut[1],void * _primIn,void * _primROut,char * _in0[1],uint32_t _in0Len[1])497 static __inline int _stub_pack(_allocator* _al, remote_arg* _praIn, remote_arg* _ppraIn[1], remote_arg* _praROut, remote_arg* _ppraROut[1], void* _primIn, void* _primROut, char* _in0[1], uint32_t _in0Len[1]) {
498 int _nErr = 0;
499 remote_arg* _praInStart = _praIn;
500 remote_arg** _ppraInStart = _ppraIn;
501 remote_arg* _praROutStart = _praROut;
502 remote_arg** _ppraROutStart = _ppraROut;
503 _ppraIn = &_praIn;
504 _ppraROut = &_praROut;
505 _in0Len[0] = (1 + strlen(_in0[0]));
506 _COPY(_primIn, 0, _in0Len, 0, 4);
507 _praIn[0].buf.pv = _in0[0];
508 _praIn[0].buf.nLen = (1 * _in0Len[0]);
509 _ppraInStart[0] += (_praIn - _praInStart) + 1;
510 _ppraROutStart[0] += (_praROut - _praROutStart) +0;
511 return _nErr;
512 }
_count(int _numIn[1],int _numROut[1],char * _in0[1],uint32_t _in0Len[1])513 static __inline void _count(int _numIn[1], int _numROut[1], char* _in0[1], uint32_t _in0Len[1]) {
514 _numIn[0] += 1;
515 _numROut[0] += 0;
516 }
_stub_method_1(remote_handle64 _handle,uint32_t _mid,uint16_t _in0[1],void * _in1[1],uint32_t _in1Len[1])517 static __inline int _stub_method_1(remote_handle64 _handle, uint32_t _mid, uint16_t _in0[1], void* _in1[1], uint32_t _in1Len[1]) {
518 remote_arg* _pra;
519 int _numIn[1];
520 int _numROut[1];
521 char* _seq_nat1;
522 int _ii;
523 _allocator _al[1] = {{0}};
524 uint32_t _primIn[2];
525 remote_arg* _praIn;
526 remote_arg** _ppraIn = &_praIn;
527 remote_arg* _praROut;
528 remote_arg** _ppraROut = &_praROut;
529 char* _seq_primIn1;
530 int _nErr = 0;
531 remote_arg* _praROutPost;
532 remote_arg** _ppraROutPost = &_praROutPost;
533 _numIn[0] = 1;
534 _numROut[0] = 0;
535 for(_ii = 0, _seq_nat1 = (char*)_in1[0];_ii < (int)_in1Len[0];++_ii, _seq_nat1 = (_seq_nat1 + SLIM_IFPTR32(8, 16)))
536 {
537 _count(_numIn, _numROut, SLIM_IFPTR32((char**)&(((uint32_t*)_seq_nat1)[0]), (char**)&(((uint64_t*)_seq_nat1)[0])), SLIM_IFPTR32((uint32_t*)&(((uint32_t*)_seq_nat1)[1]), (uint32_t*)&(((uint32_t*)_seq_nat1)[2])));
538 }
539 _allocator_init(_al, 0, 0);
540 _ALLOCATE(_nErr, _al, ((((_numIn[0] + _numROut[0]) + 1) + 0) * sizeof(_pra[0])), 4, _pra);
541 _pra[0].buf.pv = (void*)_primIn;
542 _pra[0].buf.nLen = sizeof(_primIn);
543 _COPY(_primIn, 0, _in0, 0, 2);
544 _COPY(_primIn, 4, _in1Len, 0, 4);
545 _praIn = (_pra + 1);
546 _praROut = (_praIn + _numIn[0] + 0);
547 _ALLOCATE(_nErr, _al, (_in1Len[0] * 4), 4, _praIn[0].buf.pv);
548 _praIn[0].buf.nLen = (4 * _in1Len[0]);
549 for(_ii = 0, _seq_primIn1 = (char*)_praIn[0].buf.pv, _seq_nat1 = (char*)_in1[0];_ii < (int)_in1Len[0];++_ii, _seq_primIn1 = (_seq_primIn1 + 4), _seq_nat1 = (_seq_nat1 + SLIM_IFPTR32(8, 16)))
550 {
551 _TRY(_nErr, _stub_pack(_al, (_praIn + 1), _ppraIn, (_praROut + 0), _ppraROut, _seq_primIn1, 0, SLIM_IFPTR32((char**)&(((uint32_t*)_seq_nat1)[0]), (char**)&(((uint64_t*)_seq_nat1)[0])), SLIM_IFPTR32((uint32_t*)&(((uint32_t*)_seq_nat1)[1]), (uint32_t*)&(((uint32_t*)_seq_nat1)[2]))));
552 }
553 _TRY(_nErr, __QAIC_REMOTE(remote_handle64_invoke)(_handle, REMOTE_SCALARS_MAKEX(0, _mid, (_numIn[0] + 1), (_numROut[0] + 0), 0, 0), _pra));
554 _praROutPost = _praROut;
555 for(_ii = 0, _seq_nat1 = (char*)_in1[0];_ii < (int)_in1Len[0];++_ii, _seq_nat1 = (_seq_nat1 + SLIM_IFPTR32(8, 16)))
556 {
557 _TRY(_nErr, _stub_unpack((_praROutPost + 0), _ppraROutPost, 0, SLIM_IFPTR32((char**)&(((uint32_t*)_seq_nat1)[0]), (char**)&(((uint64_t*)_seq_nat1)[0])), SLIM_IFPTR32((uint32_t*)&(((uint32_t*)_seq_nat1)[1]), (uint32_t*)&(((uint32_t*)_seq_nat1)[2]))));
558 }
559 _CATCH(_nErr) {}
560 _allocator_deinit(_al);
561 return _nErr;
562 }
__QAIC_STUB(adsp_current_process1_set_logging_params)563 __QAIC_STUB_EXPORT int __QAIC_STUB(adsp_current_process1_set_logging_params)(remote_handle64 _handle, unsigned short mask, const _cstring1_t* filesToLog, int filesToLogLen) __QAIC_STUB_ATTRIBUTE {
564 uint32_t _mid = 4;
565 return _stub_method_1(_handle, _mid, (uint16_t*)&mask, (void**)&filesToLog, (uint32_t*)&filesToLogLen);
566 }
_stub_method_2(remote_handle64 _handle,uint32_t _mid,uint32_t _rout0[1])567 static __inline int _stub_method_2(remote_handle64 _handle, uint32_t _mid, uint32_t _rout0[1]) {
568 int _numIn[1];
569 remote_arg _pra[1];
570 uint32_t _primROut[1];
571 int _nErr = 0;
572 _numIn[0] = 0;
573 _pra[(_numIn[0] + 0)].buf.pv = (void*)_primROut;
574 _pra[(_numIn[0] + 0)].buf.nLen = sizeof(_primROut);
575 _TRY(_nErr, __QAIC_REMOTE(remote_handle64_invoke)(_handle, REMOTE_SCALARS_MAKEX(0, _mid, 0, 1, 0, 0), _pra));
576 _COPY(_rout0, 0, _primROut, 0, 4);
577 _CATCH(_nErr) {}
578 return _nErr;
579 }
__QAIC_STUB(adsp_current_process1_getASID)580 __QAIC_STUB_EXPORT int __QAIC_STUB(adsp_current_process1_getASID)(remote_handle64 _handle, unsigned int* asid) __QAIC_STUB_ATTRIBUTE {
581 uint32_t _mid = 5;
582 return _stub_method_2(_handle, _mid, (uint32_t*)asid);
583 }
584 #ifdef __cplusplus
585 }
586 #endif
587 #endif //_ADSP_CURRENT_PROCESS1_STUB_H
588