Mercurial > pub > dyncall > dyncall
annotate dyncall/dyncall_callvm_ppc64.c @ 84:67961454902b
- bigger cleanup in callvm code
* changed init of most callvms to reuse code and for consistency
* removed unused functions
* general changes for consistency
* added some missing cconv defines do mode calls
- fixed potential buffer overrun on arm64
- fixed sparc and x64 mode setting (only one mode, but wasn't (pointlessly) resettable)
- error code handling (dcGetError) changes, flag is now cleared (work still underway)
- Changelog update
author | cslag |
---|---|
date | Wed, 06 Apr 2016 00:21:51 +0200 |
parents | 54930a037e8a |
children | ad5f9803f52f |
rev | line source |
---|---|
0 | 1 /* |
2 | |
3 Package: dyncall | |
4 Library: dyncall | |
5 File: dyncall/dyncall_callvm_ppc64.c | |
6 Description: | |
7 License: | |
8 | |
9 Copyright (c) 2014-2015 Masanori Mitsugi <mitsugi@linux.vnet.ibm.com> | |
10 | |
11 Permission to use, copy, modify, and distribute this software for any | |
12 purpose with or without fee is hereby granted, provided that the above | |
13 copyright notice and this permission notice appear in all copies. | |
14 | |
15 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
16 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
17 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
18 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
20 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
21 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
22 | |
23 */ | |
24 | |
25 | |
26 /* | |
27 | |
28 dyncall callvm for ppc64 architectures | |
29 | |
30 SUPPORTED CALLING CONVENTIONS | |
31 ppc64/linux | |
7 | 32 ppc64/syscall |
0 | 33 |
34 REVISION | |
7 | 35 2015/07/08 added syscall |
0 | 36 2014/08/07 initial support |
37 | |
38 */ | |
39 | |
40 #include "dyncall_callvm_ppc64.h" | |
41 #include "dyncall_call_ppc64.h" | |
42 #include "dyncall_alloc.h" | |
43 #include "dyncall_macros.h" | |
44 #include "dyncall_types.h" | |
45 | |
46 /* Support for Power PC 64-bit */ | |
47 | |
48 static void dc_callvm_free_ppc64(DCCallVM* in_self) | |
49 { | |
50 dcFreeMem(in_self); | |
51 } | |
52 | |
53 static void dc_callvm_reset_ppc64(DCCallVM* in_self) | |
54 { | |
55 DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self; | |
56 dcVecReset(&self->mVecHead); | |
57 self->mIntRegs = 0; | |
58 self->mFloatRegs = 0; | |
59 } | |
60 | |
61 /* fillup integer register file AND push on stack (for ellipsis) */ | |
62 | |
63 static void dc_callvm_argInt_ppc64(DCCallVM* in_self, DCint i) | |
64 { | |
65 /* promote to longlong */ | |
66 dcArgLongLong(in_self, (DClonglong)i); | |
67 } | |
68 | |
69 /** floating-point **/ | |
70 | |
71 /* double*/ | |
72 | |
73 static void dc_callvm_argDouble_ppc64(DCCallVM* in_self, DCdouble d) | |
74 { | |
75 DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self; | |
76 | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
77 if (self->mFloatRegs < 13) { |
0 | 78 self->mRegData.mFloatData[self->mFloatRegs++] = d; |
79 if (self->mIntRegs < 8) { | |
80 self->mRegData.mIntData[self->mIntRegs++] = *( (DClonglong*) &d ); | |
81 #if DC__ABI_PPC64_ELF_V == 2 | |
82 return; | |
83 #endif | |
84 } | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
85 } |
0 | 86 |
87 #if DC__ABI_PPC64_ELF_V == 2 | |
88 if (dcVecSize(&self->mVecHead) == 0) { | |
89 dcVecSkip(&self->mVecHead,sizeof(DClonglong)*8); | |
90 } | |
91 #endif | |
92 | |
93 /* push on stack */ | |
94 dcVecAppend(&self->mVecHead,(DCpointer) &d,sizeof(DCdouble)); | |
95 } | |
96 | |
97 #if DC__ABI_PPC64_ELF_V == 2 | |
98 static void dc_callvm_argDouble_ppc64_ellipsis(DCCallVM* in_self, DCdouble d) | |
99 { | |
100 DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self; | |
101 | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
102 if (dcVecSize(&self->mVecHead) == 0) |
0 | 103 dcVecSkip(&self->mVecHead,(sizeof(DClonglong))*(self->mIntRegs)); |
104 | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
105 if (self->mFloatRegs < 13) { |
0 | 106 self->mRegData.mFloatData[self->mFloatRegs++] = d; |
107 if (self->mIntRegs < 8) { | |
108 self->mRegData.mIntData[self->mIntRegs++] = *( (DClonglong*) &d ); | |
109 } | |
110 } | |
111 | |
112 /* push on stack */ | |
113 dcVecAppend(&self->mVecHead,(DCpointer) &d,sizeof(DCdouble)); | |
114 } | |
115 #endif | |
116 | |
117 | |
118 /* Floating-point */ | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
119 |
0 | 120 static void dc_callvm_argFloat_ppc64(DCCallVM* in_self, DCfloat f) |
121 { | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
122 DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
123 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
124 DCdouble d; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
125 #if defined(DC__Endian_BIG) |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
126 struct { DCfloat f_pad; DCfloat f; } sf; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
127 #else /* Endian_LITTLE */ |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
128 struct { DCfloat f; DCfloat f_pad; } sf; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
129 #endif |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
130 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
131 if (self->mFloatRegs < 13) { |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
132 d = (DCdouble)f; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
133 self->mRegData.mFloatData[self->mFloatRegs++] = d; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
134 if (self->mIntRegs < 8) { |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
135 self->mRegData.mIntData[self->mIntRegs++] = *( (DClonglong*) &d ); |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
136 #if DC__ABI_PPC64_ELF_V == 2 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
137 return; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
138 #endif |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
139 } |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
140 } |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
141 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
142 #if DC__ABI_PPC64_ELF_V == 2 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
143 if (dcVecSize(&self->mVecHead) == 0) { |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
144 dcVecSkip(&self->mVecHead,sizeof(DClonglong)*8); |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
145 } |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
146 #endif |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
147 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
148 /* push on stack */ |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
149 sf.f = f; |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
150 dcVecAppend(&self->mVecHead,(DCpointer) &sf,sizeof(DCdouble)); |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
151 } |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
152 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
153 #if DC__ABI_PPC64_ELF_V == 2 |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
154 static void dc_callvm_argFloat_ppc64_ellipsis(DCCallVM* in_self, DCfloat f) |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
155 { |
0 | 156 /* promote to double */ |
157 dcArgDouble(in_self, (DCdouble) f ); | |
158 } | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
159 #endif |
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
160 |
0 | 161 |
162 /* long long integer */ | |
163 | |
164 static void dc_callvm_argLongLong_ppc64(DCCallVM* in_self, DClonglong L) | |
165 { | |
166 DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self; | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
167 |
0 | 168 /* fillup integer register file */ |
169 if (self->mIntRegs < 8) { | |
170 self->mRegData.mIntData[self->mIntRegs++] = L; | |
171 #if DC__ABI_PPC64_ELF_V == 2 | |
172 return; | |
173 #endif | |
174 } | |
175 | |
176 #if DC__ABI_PPC64_ELF_V == 2 | |
177 if (dcVecSize(&self->mVecHead) == 0) { | |
178 dcVecSkip(&self->mVecHead,sizeof(DClonglong)*8); | |
179 } | |
180 #endif | |
181 | |
182 /* push on stack */ | |
183 dcVecAppend(&self->mVecHead,&L,sizeof(DClonglong)); | |
184 } | |
185 | |
186 #if DC__ABI_PPC64_ELF_V == 2 | |
187 static void dc_callvm_argLongLong_ppc64_ellipsis(DCCallVM* in_self, DClonglong L) | |
188 { | |
189 DCCallVM_ppc64* self = (DCCallVM_ppc64*)in_self; | |
190 | |
191 if (dcVecSize(&self->mVecHead) == 0) | |
192 dcVecSkip(&self->mVecHead,(sizeof(DClonglong))*(self->mIntRegs)); | |
193 | |
194 if (self->mIntRegs < 8) | |
195 self->mRegData.mIntData[self->mIntRegs++] = L; | |
196 | |
197 /* push on stack */ | |
198 dcVecAppend(&self->mVecHead,&L,sizeof(DClonglong)); | |
199 } | |
200 #endif | |
201 | |
202 | |
203 static void dc_callvm_argBool_ppc64(DCCallVM* in_self, DCbool x) | |
204 { | |
205 /* promote to longlong */ | |
206 dcArgLongLong(in_self, (DClonglong) x ); | |
207 } | |
208 | |
209 | |
210 static void dc_callvm_argChar_ppc64(DCCallVM* in_self, DCchar ch) | |
211 { | |
212 /* promote to longlong */ | |
213 dcArgLongLong(in_self, (DClonglong) ch ); | |
214 } | |
215 | |
216 | |
217 static void dc_callvm_argShort_ppc64(DCCallVM* in_self, DCshort s) | |
218 { | |
219 /* promote to longlong */ | |
220 dcArgLongLong(in_self, (DClonglong) s ); | |
221 } | |
222 | |
223 | |
224 static void dc_callvm_argLong_ppc64(DCCallVM* in_self, DClong l) | |
225 { | |
226 /* promote to longlong */ | |
227 dcArgLongLong(in_self, (DClonglong) l ); | |
228 } | |
229 | |
230 | |
231 static void dc_callvm_argPointer_ppc64(DCCallVM* in_self, DCpointer p) | |
232 { | |
233 /* promote to longlong */ | |
234 dcArgLongLong(in_self, *(DClonglong *) &p ); | |
235 } | |
236 | |
237 | |
238 void dc_callvm_call_ppc64(DCCallVM* in_self, DCpointer target) | |
239 { | |
240 DCCallVM_ppc64* self = (DCCallVM_ppc64*) in_self; | |
241 int size = dcVecSize(&self->mVecHead); | |
242 | |
243 if (size < 64) { | |
244 dcVecSkip(&self->mVecHead, 64-size); | |
245 } | |
246 | |
247 dcCall_ppc64( target, &self->mRegData, dcVecSize(&self->mVecHead) , dcVecData(&self->mVecHead)); | |
248 } | |
249 | |
7 | 250 void dc_callvm_call_ppc64_syscall(DCCallVM* in_self, DCpointer target) |
251 { | |
252 DCCallVM_ppc64* self = (DCCallVM_ppc64*) in_self; | |
253 dcCall_ppc64_syscall( target, &self->mRegData, dcVecSize(&self->mVecHead) , dcVecData(&self->mVecHead)); | |
254 } | |
255 | |
0 | 256 void dc_callvm_mode_ppc64(DCCallVM* in_self, DCint mode); |
257 | |
258 DCCallVM_vt gVT_ppc64 = | |
259 { | |
260 &dc_callvm_free_ppc64 | |
261 , &dc_callvm_reset_ppc64 | |
262 , &dc_callvm_mode_ppc64 | |
263 , &dc_callvm_argBool_ppc64 | |
264 , &dc_callvm_argChar_ppc64 | |
265 , &dc_callvm_argShort_ppc64 | |
266 , &dc_callvm_argInt_ppc64 | |
267 , &dc_callvm_argLong_ppc64 | |
268 , &dc_callvm_argLongLong_ppc64 | |
269 , &dc_callvm_argFloat_ppc64 | |
270 , &dc_callvm_argDouble_ppc64 | |
271 , &dc_callvm_argPointer_ppc64 | |
272 , NULL /* argStruct */ | |
273 , (DCvoidvmfunc*) &dc_callvm_call_ppc64 | |
274 , (DCboolvmfunc*) &dc_callvm_call_ppc64 | |
275 , (DCcharvmfunc*) &dc_callvm_call_ppc64 | |
276 , (DCshortvmfunc*) &dc_callvm_call_ppc64 | |
277 , (DCintvmfunc*) &dc_callvm_call_ppc64 | |
278 , (DClongvmfunc*) &dc_callvm_call_ppc64 | |
279 , (DClonglongvmfunc*) &dc_callvm_call_ppc64 | |
280 , (DCfloatvmfunc*) &dc_callvm_call_ppc64 | |
281 , (DCdoublevmfunc*) &dc_callvm_call_ppc64 | |
282 , (DCpointervmfunc*) &dc_callvm_call_ppc64 | |
283 , NULL /* callStruct */ | |
284 }; | |
285 | |
286 #if DC__ABI_PPC64_ELF_V == 2 | |
287 DCCallVM_vt gVT_ppc64_ellipsis = | |
288 { | |
289 &dc_callvm_free_ppc64 | |
290 , &dc_callvm_reset_ppc64 | |
291 , &dc_callvm_mode_ppc64 | |
292 , &dc_callvm_argBool_ppc64 | |
293 , &dc_callvm_argChar_ppc64 | |
294 , &dc_callvm_argShort_ppc64 | |
295 , &dc_callvm_argInt_ppc64 | |
296 , &dc_callvm_argLong_ppc64 | |
297 , &dc_callvm_argLongLong_ppc64_ellipsis | |
83
54930a037e8a
- PPC64 single-precision float fixes for more than 13 float args (thanks Masanori!)
cslag
parents:
7
diff
changeset
|
298 , &dc_callvm_argFloat_ppc64_ellipsis |
0 | 299 , &dc_callvm_argDouble_ppc64_ellipsis |
300 , &dc_callvm_argPointer_ppc64 | |
301 , NULL /* argStruct */ | |
302 , (DCvoidvmfunc*) &dc_callvm_call_ppc64 | |
303 , (DCboolvmfunc*) &dc_callvm_call_ppc64 | |
304 , (DCcharvmfunc*) &dc_callvm_call_ppc64 | |
305 , (DCshortvmfunc*) &dc_callvm_call_ppc64 | |
306 , (DCintvmfunc*) &dc_callvm_call_ppc64 | |
307 , (DClongvmfunc*) &dc_callvm_call_ppc64 | |
308 , (DClonglongvmfunc*) &dc_callvm_call_ppc64 | |
309 , (DCfloatvmfunc*) &dc_callvm_call_ppc64 | |
310 , (DCdoublevmfunc*) &dc_callvm_call_ppc64 | |
311 , (DCpointervmfunc*) &dc_callvm_call_ppc64 | |
312 , NULL /* callStruct */ | |
313 }; | |
314 #endif | |
315 | |
7 | 316 DCCallVM_vt gVT_ppc64_syscall = |
317 { | |
318 &dc_callvm_free_ppc64 | |
319 , &dc_callvm_reset_ppc64 | |
320 , &dc_callvm_mode_ppc64 | |
321 , &dc_callvm_argBool_ppc64 | |
322 , &dc_callvm_argChar_ppc64 | |
323 , &dc_callvm_argShort_ppc64 | |
324 , &dc_callvm_argInt_ppc64 | |
325 , &dc_callvm_argLong_ppc64 | |
326 , &dc_callvm_argLongLong_ppc64 | |
327 , &dc_callvm_argFloat_ppc64 | |
328 , &dc_callvm_argDouble_ppc64 | |
329 , &dc_callvm_argPointer_ppc64 | |
330 , NULL /* argStruct */ | |
331 , (DCvoidvmfunc*) &dc_callvm_call_ppc64_syscall | |
332 , (DCboolvmfunc*) &dc_callvm_call_ppc64_syscall | |
333 , (DCcharvmfunc*) &dc_callvm_call_ppc64_syscall | |
334 , (DCshortvmfunc*) &dc_callvm_call_ppc64_syscall | |
335 , (DCintvmfunc*) &dc_callvm_call_ppc64_syscall | |
336 , (DClongvmfunc*) &dc_callvm_call_ppc64_syscall | |
337 , (DClonglongvmfunc*) &dc_callvm_call_ppc64_syscall | |
338 , (DCfloatvmfunc*) &dc_callvm_call_ppc64_syscall | |
339 , (DCdoublevmfunc*) &dc_callvm_call_ppc64_syscall | |
340 , (DCpointervmfunc*) &dc_callvm_call_ppc64_syscall | |
341 , NULL /* callStruct */ | |
342 }; | |
343 | |
0 | 344 void dc_callvm_mode_ppc64(DCCallVM* in_self, DCint mode) |
345 { | |
346 DCCallVM_ppc64* self = (DCCallVM_ppc64*) in_self; | |
347 DCCallVM_vt* vt; | |
84 | 348 |
0 | 349 switch(mode) { |
84 | 350 case DC_CALL_C_DEFAULT: |
0 | 351 case DC_CALL_C_PPC64: |
352 case DC_CALL_C_ELLIPSIS: | |
353 #if DC__ABI_PPC64_ELF_V == 2 | |
354 vt = &gVT_ppc64; | |
355 break; | |
356 case DC_CALL_C_ELLIPSIS_VARARGS: | |
357 vt = &gVT_ppc64_ellipsis; | |
358 break; | |
359 #else | |
360 case DC_CALL_C_ELLIPSIS_VARARGS: | |
361 vt = &gVT_ppc64; | |
362 break; | |
363 #endif | |
364 | |
7 | 365 case DC_CALL_SYS_DEFAULT: |
366 case DC_CALL_SYS_PPC64: | |
367 vt = &gVT_ppc64_syscall; | |
368 break; | |
369 | |
0 | 370 default: |
371 self->mInterface.mError = DC_ERROR_UNSUPPORTED_MODE; | |
372 return; | |
373 } | |
374 | |
375 dc_callvm_base_init(&self->mInterface, vt); | |
376 } | |
377 | |
84 | 378 /* Public API. */ |
0 | 379 DCCallVM* dcNewCallVM(DCsize size) |
380 { | |
84 | 381 DCCallVM_ppc64* p = (DCCallVM_ppc64*)dcAllocMem(sizeof(DCCallVM_ppc64)+size); |
382 | |
383 dc_callvm_mode_ppc64((DCCallVM*)p, DC_CALL_C_DEFAULT); | |
384 | |
385 dcVecInit(&p->mVecHead, size); | |
386 dc_callvm_reset_ppc64((DCCallVM*)p); | |
387 | |
388 return (DCCallVM*)p; | |
0 | 389 } |
390 |