Commit Graph

74 Commits

Author SHA1 Message Date
gibbed
975eadf17e [Kernel] Assert export function return/arg types. 2022-01-09 14:16:37 -06:00
gibbed
12ec728989 [Kernel] Use tables for export groups. 2022-01-09 14:16:37 -06:00
gibbed
3ad0a7dab2 [Kernel] Suffix export functions with _entry. 2022-01-09 12:17:03 -06:00
Joel Linn
c0fb300a05 [Kernel] Remove explicit SHIM calling convention
Shim exports are called from GuestToHostThunk which dictates the calling
convention. The default system calling convention is different depending
on OS (Windows vs. everything else) and architecture. PR #1339 addresses
this for x64 Linux.
There is no reason for explicit `__cdecl`. Also, it is not available in
GCC. We could use `__attribute__((ms_abi))` or
`__attribute__((sysv_abi))` but that just adds complexity.
2021-06-02 22:28:43 -05:00
Joel Linn
07a060b002 [Kernel] Solve ambiguity in RegisterExport()
- Remove overload for exports with `void` return type
- Use `if constexpr (std::is_void<R>::value)` to differentiate
2021-06-02 22:28:43 -05:00
Triang3l
e49e26e4a0 [Kernel] shim_utils lint fix 2021-05-16 18:34:27 +03:00
gibbed
524efcab7d [Kernel] Lint fix. 2021-05-01 12:20:14 -05:00
Sandy Carter
432369ae84 [kernel] Define param order between compilers
Fix issue in clang where args were inverted last to first due to the way
c++ implements function calls.
The function make_tuple, being a function, has undefined ordering of
resolution of the values of its parameters `Ps(init)` and would vary
between compilers. Namely clang would resolve them in order and msvc
would resolve them in reverse order.
This normally would not matter except for the fact that init maintains
a mutable state which is affected my the order of operations:
init.ordinal is a counter and also defines where in memory a value is
stored.
The C++ standard doesn't define an order of resolution of parameters in
a function but it will define an order in a brace-initializer.
Switching make_tuple for a brace-initializer enforces an order which is
the same between all compilers (tested gcc, clang and msvc).
Prior code was written to decrement ordinal due to the reverse
traversal.
This has been switched to incrementing thanks to the in-order
traversal.
2020-11-22 13:54:00 +03:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
gibbed
5bf0b34445 C++17ification.
C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
2020-04-07 16:09:41 -05:00
Triang3l
803fa0cba9 [Kernel] Fix TranslateUnicodeString endian and size 2019-08-28 09:20:10 +03:00
Triang3l
2507f1a819 [Memory] TranslateVirtual in shim and strings 2019-08-14 10:31:11 +03:00
Triang3l
0067f5561d [Kernel] More TranslateVirtual/HostToGuestVirtual usage 2019-08-14 08:28:30 +03:00
Jonathan Goyvaerts
c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
gibbed
bc0ebcb26e - Clean up log level names, no need for LOG_LEVEL_ prefix when it is an
enum class.
- Clarify usage of log level in comment.
2019-04-30 17:41:27 -05:00
gibbed
08fb15fcca [Kernel] Oops. 2018-11-24 19:16:14 -06:00
gibbed
394105d359 [CPU/Kernel] Cleanup and rework of how kernel exports are declared. 2018-11-20 13:03:17 -06:00
gibbed
fc0cc89a1d [Kernel] Add X_HRESULT_result. (yes, the name is stupid) 2018-05-27 18:12:48 -05:00
DrChat
aaf281351d Format all code with new clang-format 2017-12-14 20:44:43 -06:00
Dr. Chat
4f0c0f2724 Shims: No implicit dereferencing of pointers 2017-05-17 04:45:31 -05:00
DrChat
e699be0118 Logging: Add a flag to specify the minimum log level
--log_level = (0=error, 1=warning, 2=info, 3=debug)
2017-03-24 16:28:41 -05:00
gibbed
cec8932605 Log lpwstring_t contents. 2017-01-09 23:57:47 -06:00
gibbed
d17d02f606 Log lpstring_t contents. 2017-01-09 17:11:17 -06:00
gibbed
2e8c34377f Implemented NetDll_shutdown.
De-borked LoadFdset/StoreFdset in regards to handling of correct counts
and invalid sockets.
2017-01-09 06:58:15 -06:00
gibbed
d730784efb Added XBDM stubs. 2017-01-09 04:51:55 -06:00
maxton
cc0adb95f1 Add word pointer type 2016-12-20 18:22:41 -05:00
gibbed
096febb3bb Oops. Unbreaking shim_utils.h. 2016-06-18 14:02:38 -05:00
gibbed
4fc3bdf213 Fixed AppendParam for X_EX_TITLE_TERMINATE_REGISTRATION,
X_EXCEPTION_RECORD.
Added AppendParam for X_OBJECT_ATTRIBUTES.
2016-06-18 13:44:52 -05:00
Ben Vanik
2f012fb56d Though I disagree with these lint fixes, I want travis to shut up. 2016-01-01 18:38:20 +00:00
Ben Vanik
b02ca62388 Fixing most remaining C++ warnings in clang. 2016-01-01 18:37:33 +00:00
Ben Vanik
15816327b4 Renaming xe::cpu::frontend to xe::cpu::ppc. 2015-12-14 21:17:55 -08:00
Dr. Chat
b12480820c word_t shim parameter 2015-09-25 18:38:33 -05:00
Ben Vanik
6c07eb8e5c Faster RtlFillMemoryUlong. 2015-09-05 14:38:07 -07:00
Ben Vanik
311b65537d --log_high_frequency_kernel_calls (defaults to false) to cull some lines. 2015-09-01 18:20:08 -07:00
Ben Vanik
a86b3821f2 Adding thread handle to logging. 2015-08-29 20:49:26 -07:00
Ben Vanik
a92566dfc5 More style. 2015-08-07 21:29:03 -07:00
Ben Vanik
14beb27ebc xb style. 2015-08-07 07:56:57 -07:00
Dr. Chat
e37479c7b0 Convert strings before returning them 2015-07-27 18:23:11 -05:00
Dr. Chat
c536053dec Fix improper getting arguments from stack
Also fix PrimitivePointerParam conversion error
2015-07-24 23:08:55 -05:00
Ben Vanik
5bd7833e87 More clang fixes. xenia-kernel is clean. 2015-07-19 21:29:06 -07:00
Ben Vanik
bebda48a4f More clang fixes. 2015-07-19 20:46:14 -07:00
Ben Vanik
f520d3a2a4 Run with latest clang-format. 2015-07-15 22:44:30 -07:00
Dr. Chat
f0060f8335 Allow direct typecasting of Result shim util class 2015-07-11 18:14:33 -05:00
Dr. Chat
287a761987 Fix AppendParam dereferencing NULL pointers 2015-06-25 19:29:37 -05:00
Drew DeVault
a064ba053e Add missing includes for cstring 2015-06-16 23:16:18 -06:00
Ben Vanik
862c322cbc Fixing stack args and error typo. 2015-06-01 23:36:05 -07:00
Ben Vanik
19cb13692b Fixing undefined export names. 2015-06-01 22:12:11 -07:00
Ben Vanik
5c34b0a73e Fixing printfs and fixing exports. link.exe is too good. 2015-06-01 21:40:53 -07:00
Ben Vanik
a91a754b24 Converting some exports to the new way. 2015-06-01 20:56:57 -07:00
Ben Vanik
f634edb9eb Shrinking type names. 2015-06-01 19:55:43 -07:00