comparison dyncallback/dyncall_callback_sparc64.c @ 191:2f7a7f3472cb

- first draft at sparc64 callbacks (floats not working, yet)
author Tassilo Philipp
date Fri, 17 Mar 2017 03:27:36 +0100
parents d48a8b8d2ef9
children 030fbb70aa1b
comparison
equal deleted inserted replaced
190:06ee88ce4962 191:2f7a7f3472cb
1 /* 1 /*
2 2
3 Package: dyncall 3 Package: dyncall
4 Library: dyncallback 4 Library: dyncallback
5 File: dyncallback/dyncall_callback_sparc64.c 5 File: dyncallback/dyncall_callback_sparc64.c
6 Description: Callback - Implementation for sparc64 (TODO: not implemented yet) 6 Description: Callback - Implementation for sparc64
7 License: 7 License:
8 8
9 Copyright (c) 2007-2016 Daniel Adler <dadler@uni-goettingen.de>, 9 Copyright (c) 2007-2017 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.
31 /* Callback symbol. */ 31 /* Callback symbol. */
32 extern void dcCallbackThunkEntry(); 32 extern void dcCallbackThunkEntry();
33 33
34 struct DCCallback 34 struct DCCallback
35 { 35 {
36 DCThunk thunk; /* offset 0, size ?? */ 36 DCThunk thunk; /* offset 0, size 56 */
37 DCCallbackHandler* handler; /* offset ??, size 4 */ 37 DCCallbackHandler* handler; /* offset 56, size 8 */
38 size_t stack_cleanup; /* offset ??, size 4 */ 38 void* userdata; /* offset 64, size 8 */
39 void* userdata; /* offset ??, size 4 */
40 }; 39 };
41 40
42 41
43 void dcbInitCallback(DCCallback* pcb, const char* signature, DCCallbackHandler* handler, void* userdata) 42 void dcbInitCallback(DCCallback* pcb, const char* signature, DCCallbackHandler* handler, void* userdata)
44 { 43 {
44 pcb->handler = handler;
45 pcb->userdata = userdata;
45 } 46 }
46 47
47 DCCallback* dcbNewCallback(const char* signature, DCCallbackHandler* handler, void* userdata) 48 DCCallback* dcbNewCallback(const char* signature, DCCallbackHandler* handler, void* userdata)
48 { 49 {
49 DCCallback* pcb; 50 DCCallback* pcb;