0
|
1 /*
|
|
2
|
|
3 Package: dyncall
|
|
4 Library: dyncall
|
|
5 File: dyncall/dyncall_call_mips_n64.h
|
|
6 Description: mips "n64" ABI call-kernel C interface.
|
|
7 License:
|
|
8
|
281
|
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>,
|
0
|
10 Tassilo Philipp <tphilipp@potion-studios.com>
|
|
11
|
|
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
|
|
14 copyright notice and this permission notice appear in all copies.
|
|
15
|
|
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
23
|
|
24 */
|
|
25
|
|
26
|
|
27
|
|
28 #ifndef DYNCALL_CALL_MIPS_N64_H
|
|
29 #define DYNCALL_CALL_MIPS_N64_H
|
|
30
|
|
31 #include "dyncall_types.h"
|
|
32
|
|
33 #ifdef __cplusplus
|
|
34 extern "C" {
|
|
35 #endif
|
|
36
|
|
37 /*
|
|
38 two register-files for integer (promoted to 64-bit) and float (not promoted!)
|
|
39 are used.
|
|
40
|
|
41 arguments are transfered in a free slot on the corresponding register file.
|
|
42 the other register-file will be skipped by one.
|
|
43
|
|
44 float arguments are either loaded from single or double -
|
|
45 a auto-conversion into double and then loaded as double precision
|
|
46 turned out to fail for several tests.
|
|
47
|
|
48 therefore a union for storage of float or double is used instead.
|
|
49 a bitmask (mUseDouble) records which type is used and will be
|
|
50 interpreted in the call-kernel.
|
|
51 */
|
|
52
|
|
53 struct DCRegData_mips_n64
|
|
54 {
|
131
|
55 DClonglong mIntData[8];
|
305
|
56 #if defined(DC__ABI_HARDFLOAT)
|
0
|
57 union { DCfloat f; DCdouble d; } mFloatData[8];
|
131
|
58 DClonglong mUseDouble; /* bitmask: lower 8 bits specify to use float or double from union array. */
|
305
|
59 #endif /* DC__ABI_HARDFLOAT */
|
0
|
60 };
|
|
61
|
|
62 void dcCall_mips_n64(DCpointer target, struct DCRegData_mips_n64* regdata, DCsize stksize, DCpointer stkdata);
|
|
63
|
|
64 #ifdef __cplusplus
|
|
65 }
|
|
66 #endif
|
|
67
|
|
68
|
|
69 #endif /* DYNCALL_CALL_MIPS_N64_H */
|
|
70
|