Mercurial > pub > dyncall > dyncall
comparison dyncallback/dyncall_callback_x86.c @ 364:3bdd326dc269
- Todo entries
- some clarifications in code about GNU thiscalls (which are effectively idential to cdecl calls)
* took away own mode identifier, as aliasing to cdecl now
- cleanups
author | Tassilo Philipp |
---|---|
date | Tue, 14 Apr 2020 19:35:30 +0200 |
parents | 30aae7371373 |
children | ddfb9577a00e |
comparison
equal
deleted
inserted
replaced
363:3ff4a4ba7f0e | 364:3bdd326dc269 |
---|---|
4 Library: dyncallback | 4 Library: dyncallback |
5 File: dyncallback/dyncall_callback_x86.c | 5 File: dyncallback/dyncall_callback_x86.c |
6 Description: Callback - Implementation for x86 | 6 Description: Callback - Implementation for x86 |
7 License: | 7 License: |
8 | 8 |
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, | 9 Copyright (c) 2007-2020 Daniel Adler <dadler@uni-goettingen.de>, |
10 Tassilo Philipp <tphilipp@potion-studios.com> | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | 11 |
12 Permission to use, copy, modify, and distribute this software for any | 12 Permission to use, copy, modify, and distribute this software for any |
13 purpose with or without fee is hereby granted, provided that the above | 13 purpose with or without fee is hereby granted, provided that the above |
14 copyright notice and this permission notice appear in all copies. | 14 copyright notice and this permission notice appear in all copies. |
202 { | 202 { |
203 ptr++; | 203 ptr++; |
204 ch = *ptr++; | 204 ch = *ptr++; |
205 switch(ch) { | 205 switch(ch) { |
206 case DC_SIGCHAR_CC_DEFAULT: mode = DC_CALL_C_DEFAULT; break; | 206 case DC_SIGCHAR_CC_DEFAULT: mode = DC_CALL_C_DEFAULT; break; |
207 /*@@@ add ellipsis?*/ | 207 case DC_SIGCHAR_CC_THISCALL_GNU: // == cdecl |
208 case DC_SIGCHAR_CC_CDECL: mode = DC_CALL_C_X86_CDECL; break; | 208 case DC_SIGCHAR_CC_CDECL: mode = DC_CALL_C_X86_CDECL; break; |
209 case DC_SIGCHAR_CC_STDCALL: mode = DC_CALL_C_X86_WIN32_STD; break; | 209 case DC_SIGCHAR_CC_STDCALL: mode = DC_CALL_C_X86_WIN32_STD; break; |
210 case DC_SIGCHAR_CC_FASTCALL_MS: mode = DC_CALL_C_X86_WIN32_FAST_MS; break; | 210 case DC_SIGCHAR_CC_FASTCALL_MS: mode = DC_CALL_C_X86_WIN32_FAST_MS; break; |
211 case DC_SIGCHAR_CC_FASTCALL_GNU: mode = DC_CALL_C_X86_WIN32_FAST_GNU; break; | 211 case DC_SIGCHAR_CC_FASTCALL_GNU: mode = DC_CALL_C_X86_WIN32_FAST_GNU; break; |
212 case DC_SIGCHAR_CC_THISCALL_MS: mode = DC_CALL_C_X86_WIN32_THIS_MS; break; | 212 case DC_SIGCHAR_CC_THISCALL_MS: mode = DC_CALL_C_X86_WIN32_THIS_MS; break; |
213 case DC_SIGCHAR_CC_THISCALL_GNU: mode = DC_CALL_C_X86_WIN32_THIS_GNU; break; | |
214 case DC_SIGCHAR_CC_SYSCALL: mode = DC_CALL_SYS_DEFAULT; break; | |
215 } | 213 } |
216 } | 214 } |
217 | 215 |
218 /* x86 configuration: */ | 216 /* x86 configuration: */ |
219 | 217 |
224 break; | 222 break; |
225 case DC_CALL_C_X86_WIN32_STD: | 223 case DC_CALL_C_X86_WIN32_STD: |
226 pcb->args_vt = &dcArgsVT_default; | 224 pcb->args_vt = &dcArgsVT_default; |
227 pcb->stack_cleanup = dcbCleanupSize_x86_std(ptr); | 225 pcb->stack_cleanup = dcbCleanupSize_x86_std(ptr); |
228 break; | 226 break; |
227 case DC_CALL_C_X86_WIN32_FAST_MS: | |
228 pcb->args_vt = &dcArgsVT_fast_ms; | |
229 pcb->stack_cleanup = dcbCleanupSize_x86_fast_ms(ptr); | |
230 break; | |
231 case DC_CALL_C_X86_WIN32_FAST_GNU: | |
232 pcb->args_vt = &dcArgsVT_fast_gnu; | |
233 pcb->stack_cleanup = dcbCleanupSize_x86_fast_gnu(ptr); | |
234 break; | |
229 case DC_CALL_C_X86_WIN32_THIS_MS: | 235 case DC_CALL_C_X86_WIN32_THIS_MS: |
230 pcb->args_vt = &dcArgsVT_this_ms; | 236 pcb->args_vt = &dcArgsVT_this_ms; |
231 pcb->stack_cleanup = dcbCleanupSize_x86_this_ms(ptr); | 237 pcb->stack_cleanup = dcbCleanupSize_x86_this_ms(ptr); |
232 break; | |
233 case DC_CALL_C_X86_WIN32_FAST_MS: | |
234 pcb->args_vt = &dcArgsVT_fast_ms; | |
235 pcb->stack_cleanup = dcbCleanupSize_x86_fast_ms(ptr); | |
236 break; | |
237 case DC_CALL_C_X86_WIN32_FAST_GNU: | |
238 pcb->args_vt = &dcArgsVT_fast_gnu; | |
239 pcb->stack_cleanup = dcbCleanupSize_x86_fast_gnu(ptr); | |
240 break; | 238 break; |
241 } | 239 } |
242 | 240 |
243 #if defined(DC_PLAN9) | 241 #if defined(DC_PLAN9) |
244 /* HACK for Plan9 - 'reuse' pcb->stack_cleanup as a flag | 242 /* HACK for Plan9 - 'reuse' pcb->stack_cleanup as a flag |