Commit Graph

111 Commits

Author SHA1 Message Date
Ben Vanik
8588fbc6cf Shuffling kernel util types to util/. 2015-09-06 13:45:52 -07:00
Ben Vanik
3c96b6fa0a DANGER DANGER. Switching to global critical region.
This changes almost all locks held by guest threads to use a single global
critical region. This emulates the behavior on the PPC of disabling
interrupts (by calls like KeRaiseIrqlToDpcLevel or masking interrupts),
and prevents deadlocks from occuring when threads are suspended or
otherwise blocked.
This has performance implications and a pass is needed to ensure the
locking is as granular as possible. It could also break everything
because it's fundamentally unsound. We'll see.
2015-09-06 09:30:54 -07:00
Ben Vanik
f3c75b8d87 Support ObReferenceObjectByHandle for XEvents. 2015-09-01 17:42:07 -07:00
Ben Vanik
7711568af9 Implementing SetTimer and CompleteOverlappedEx APC callbacks.
Fixes #410.
2015-08-29 23:43:26 -07:00
Ben Vanik
a86b3821f2 Adding thread handle to logging. 2015-08-29 20:49:26 -07:00
Ben Vanik
ad090a40eb Fixing misuse of std::chrono. 2015-08-18 10:18:30 -07:00
Ben Vanik
a92566dfc5 More style. 2015-08-07 21:29:03 -07:00
Ben Vanik
987589dcbc Stop overwriting already-specified thread names. 2015-07-26 23:49:32 -07:00
Ben Vanik
7ecc6362de Debugger stuff. Lots of wasted work :/ 2015-07-26 22:47:16 -07:00
Dr. Chat
64089558f1 XThread set exit code on exit 2015-07-24 23:09:33 -05:00
Dr. Chat
eac3243907 Include host ID in XThread name for easier debugging 2015-07-24 18:42:30 -05:00
Dr. Chat
8e41d5a707 The kernel object table now keeps track of handle reference counts. 2015-07-22 19:34:33 -05:00
Ben Vanik
a42ab648ed Shuffling --debug around and making it work. 2015-07-22 17:26:10 -07:00
Dr. Chat
9a47082c88 Create XThread suspended and resume it when setup is complete. Fixes race condition on thread_ variable. 2015-07-22 11:56:02 -05:00
Dr. Chat
b646915b77 Make XThread use its guest KTHREAD object in the pcr in r13
Shuffle around some code in XThread
2015-07-21 22:07:30 -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
Dr. Chat
1ea5a4b7b4 XThread initialize the dispatch header 2015-07-17 19:55:09 -05:00
Ben Vanik
f520d3a2a4 Run with latest clang-format. 2015-07-15 22:44:30 -07:00
Ben Vanik
99104a25a8 Fixing thread exit. 2015-07-15 18:01:17 -07:00
Ben Vanik
345fe60da0 Switching over kernel objects to the platform-agnostic APIs.
Possibly some regressions here.
2015-07-14 22:44:45 -07:00
Dr. Chat
57e89e72b1 Use the actual thread handle as a wait handle, add bool XThread::running 2015-07-05 15:43:09 -05:00
Dr. Chat
778acac929 XThread Terminate 2015-07-05 14:44:43 -05:00
Dr. Chat
4fdebd530f XThread bool guest thread 2015-07-05 13:37:10 -05:00
Dr. Chat
1788ee1589 Linting. 2015-07-03 20:11:08 -05:00
Dr. Chat
a25090f3ca Templated XUserModule::GetOptHeader 2015-07-03 10:27:08 -05:00
Dr. Chat
029babaf5d Drop dependency on old-style xex2 headers 2015-07-03 08:15:53 -05:00
Ben Vanik
3439641101 Removing cpu.h.
Part of #296.
2015-06-27 08:58:45 -07:00
Ben Vanik
b9c39d1b33 Fixing thread exit. 2015-06-22 22:40:39 -07:00
Ben Vanik
fb1f4906d9 xb format --all (we are now format clean). Buildbot will yell at you. 2015-06-22 22:26:51 -07:00
Dr. Chat
bafd448dd8 Cleanup some XThread code 2015-06-22 21:42:33 -05:00
Ben Vanik
e4c5522c84 Merge pull request #261 from SirCmpwn/fix-std-mem
Add missing includes for cstring
2015-06-16 22:19:19 -07:00
Drew DeVault
a064ba053e Add missing includes for cstring 2015-06-16 23:16:18 -06:00
Ben Vanik
b750370759 Partial thread data plumbing. 2015-06-16 21:53:40 -07:00
gibbed
95afbe2d93 Don't allocate memory for TLS slots, and copy the default TLS data at the start, rather than offset by the TLS slot size, which seems to be more correct. 2015-06-14 03:50:45 -05:00
Dr. Chat
bdcadeffe5 XObject CreateNative 2015-06-12 21:30:32 -05:00
Dr. Chat
4c9cab4346 Make XThread create a kernel object for itself 2015-06-12 19:02:17 -05:00
Dr. Chat
41f1023549 Minor fix in XThread - checking the wrong address for NULL 2015-06-09 18:58:45 -05:00
gibbed
7f57867f49 Let's fix the strange stack overflows doing the stupid thing. 2015-06-07 18:29:09 -05:00
Ben Vanik
232c35b89e Use the right sizes. Nice catch DrChat. 2015-06-04 20:06:49 -07:00
Ben Vanik
52060af847 Best-guess process info block. 2015-06-04 17:46:00 -07:00
Ben Vanik
21474970b2 Fixing (or at least improving) TLS. 2015-06-04 16:51:53 -07:00
Dr. Chat
4f807a669c Fix TLS copying (size may still be wrong though) 2015-06-04 16:20:52 -05:00
Ben Vanik
36dc6dd864 Logging APC delivery. 2015-06-03 17:59:36 -07:00
Ben Vanik
f86f6ee79d Always set fake cpu #. 2015-06-01 23:22:25 -07:00
Ben Vanik
fccab79a7a Adding kernel state pointer to PPCContext. Still needs larger cleanup. 2015-05-31 14:35:56 -07:00
Ben Vanik
d97a6d1929 NtReadFile APC, somewhat. 2015-05-29 21:24:23 -07:00
gibbed
0050b3df83 Assign a CPU number based on the proc affinity mask on thread creation. Fixes audio threads not starting properly on Frogger 2, and possibly other titles. 2015-05-28 12:56:56 -05:00
Ben Vanik
8244409501 Refactoring to enable future time scaling, coordinated clocks, etc. 2015-05-26 22:20:58 -07:00
Ben Vanik
41cee3d337 Switching vsync to custom thread. 2015-05-25 21:12:27 -07:00