Mercurial > pub > dyncall > dyncall
comparison dyncallback/dyncall_args_x64.c @ 661:93ce63d72d59
- dyncallback code cleanup: removed unneeded headers
author | Tassilo Philipp |
---|---|
date | Thu, 14 Mar 2024 10:11:28 +0100 |
parents | b36a738c8975 |
children |
comparison
equal
deleted
inserted
replaced
660:17dff20b9c10 | 661:93ce63d72d59 |
---|---|
4 Library: dyncallback | 4 Library: dyncallback |
5 File: dyncallback/dyncall_args_x64.c | 5 File: dyncallback/dyncall_args_x64.c |
6 Description: Callback's Arguments VM - Implementation for x64 | 6 Description: Callback's Arguments VM - Implementation for x64 |
7 License: | 7 License: |
8 | 8 |
9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, | 9 Copyright (c) 2007-2024 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. |
23 | 23 |
24 */ | 24 */ |
25 | 25 |
26 | 26 |
27 | 27 |
28 #include "dyncall_args_x64.h" | 28 #include "dyncall_args.h" |
29 #include "dyncall_callvm_x64.h" /* reuse DCRegCount_x64 and DCRegData_x64_s */ | |
30 #include "dyncall_aggregate.h" | |
29 | 31 |
30 #include <assert.h> | 32 #include <assert.h> |
31 #include <string.h> | 33 #include <string.h> |
34 | |
35 | |
36 struct DCArgs | |
37 { | |
38 /* state */ | |
39 int64* stack_ptr; /* offset 0 */ | |
40 DCRegCount_x64 reg_count; /* offset 8, size:win 4, size:*nix 8 */ | |
41 #if defined(DC_WINDOWS) | |
42 int pad_w; /* alignment helper for win/x64 */ | |
43 #endif | |
44 int aggr_return_register; /* offset 16 */ | |
45 int pad; /* offset 20 */ | |
46 DCaggr** aggrs; /* offset 24 */ | |
47 | |
48 /* reg data */ | |
49 DCRegData_x64_s reg_data; /* offset 32 */ | |
50 }; | |
32 | 51 |
33 | 52 |
34 static int64* arg_i64(DCArgs* args) | 53 static int64* arg_i64(DCArgs* args) |
35 { | 54 { |
36 args->reg_count.i += (args->reg_count.i == args->aggr_return_register); | 55 args->reg_count.i += (args->reg_count.i == args->aggr_return_register); |