Commit graph

242 commits

Author SHA1 Message Date
Unknown W. Brackets
2a9c640739 When starting a thread, put old thread at end.
This matters so the right thread is run later when scheduling switches
back.
2013-03-31 09:45:41 -07:00
Unknown W. Brackets
fe60677f75 Make mutexes handle callbacks better + before.
Mutex and semaphores (but NOT lwmutexes) call callbacks before attempting
the lock, but only if it would not generate errors.

Have not yet tested other wait types.
2013-03-30 16:12:38 -07:00
Unknown W. Brackets
eace0e75c1 sceKernelWaitSemaCB() should run callbacks first.
Patapon 2 gets back to the menu with this.
2013-03-30 16:12:38 -07:00
Unknown W. Brackets
d2abdf17be Add a waittype registry to handle callbacks right. 2013-03-30 16:12:37 -07:00
Unknown W. Brackets
e4223dbcb0 Simplify adding report messages, add a bunch more. 2013-03-26 00:54:00 -07:00
Unknown W. Brackets
f89358d6ff Add some reporting in other thread functions. 2013-03-26 00:39:18 -07:00
Unknown W. Brackets
480c5c3e31 Add some reporting for broken callback situations. 2013-03-26 00:36:46 -07:00
Unknown W. Brackets
276037675f Prevent waiting on semas while dispatch disabled.
Does relatively well on tests this way.
2013-03-24 23:30:32 -07:00
Unknown W. Brackets
783df9f0c3 sceKernelResumeDispatchThread() always returns 0. 2013-03-24 20:53:51 -07:00
Unknown W. Brackets
64445e0c8d Resume dispatch on thread start. 2013-03-24 20:52:18 -07:00
Unknown W. Brackets
c9e1b01545 Don't reschedule while interrupts are disabled. 2013-03-24 19:43:56 -07:00
Unknown W. Brackets
b2fd023038 Fix return value of sceKernelSuspendDispatchThread. 2013-03-24 19:30:17 -07:00
Henrik Rydgard
84d292010a Oops, sceKernelCheckThreadStack was already implemented. Let's hope both copies are the same. 2013-03-23 14:41:13 +01:00
Henrik Rydgard
6a4ae5bb51 Implement sceKernelCheckThreadStack 2013-03-23 14:26:54 +01:00
Unknown W. Brackets
2500910d72 Fix dumb typo in sceKernelRotateThreadReadyQueue(). 2013-03-20 14:11:13 -07:00
Unknown W. Brackets
96f2d860e4 Revert thread optimization, appears to have broken things.
Fixes #1033.

This reverts commit ea91632ff5 and
commit 543dfcd4d8.
2013-03-20 14:10:20 -07:00
Unknown W. Brackets
ea91632ff5 Allow the thread ready queue to shrink, simplify. 2013-03-20 08:11:24 -07:00
Unknown W. Brackets
cd8e0e675c Small optimization to sceKernelRotateThreadReadyQueue(). 2013-03-20 00:06:19 -07:00
Unknown W. Brackets
543dfcd4d8 Optimize thread ready queue pop_front(). 2013-03-19 23:51:40 -07:00
Unknown W. Brackets
14e065cbb2 Avoid dynamic_cast() for threads where possible.
It's reasonable to trust currentThread and threadReadyQueue, and these eat
a few percentage points of time.
2013-03-16 11:17:44 -07:00
Unknown W. Brackets
d8dd889bfd Couple more minor warning fixes. 2013-03-15 08:19:02 -07:00
Unknown W. Brackets
6e54ce5551 Fix some minor warnings. 2013-03-15 00:45:47 -07:00
Unknown W. Brackets
acd7e1b6af Handle dispatch suspend/resume slightly better. 2013-03-13 23:49:39 -07:00
Unknown W. Brackets
0b9c248856 Reschedule in sceIoLseek() etc.
Also make it so we can return u64s easily in places...
2013-03-11 02:50:32 -07:00
Unknown W. Brackets
913dca69ef Turn down logging for things that can be inferred.
If you see a thread switch for a vblank wait, you know what happened.
2013-03-10 22:56:24 -07:00
Unknown W. Brackets
118050485f Show the current thread name in the log file.
This is very useful, although it kinda entwines the logging a bit
more than might be desired.
2013-03-10 22:25:03 -07:00
Unknown W. Brackets
6b7ff47617 Improve perf of __KernelExecutePendingMipsCalls().
This was using ~3% in many games with fast forward.  It was all
the RTL type lookup, so avoiding it is an easy win.
2013-03-09 14:21:21 -08:00
Unknown W. Brackets
f9fc1af5c8 Improve perf of sceKernelCheckCallback().
Some games seem to call this a lot.
2013-03-09 14:11:53 -08:00
Unknown W. Brackets
db52d3d43c Quick and dirty attempt to delay loadmodule. 2013-03-07 22:45:58 -08:00
Unknown W. Brackets
62ab4b7f51 More signed compare warnings. 2013-03-02 15:34:16 -08:00
Unknown W. Brackets
de7ada1982 Fix some x64 type warnings. 2013-02-24 10:39:06 -08:00
Unknown W. Brackets
64c42ffaf2 Fix some warnings generated by clang. 2013-02-24 10:23:31 -08:00
Unknown W. Brackets
31ada1ea07 Don't process threadsafe events from HLE.
Only from the runloop where blowing the jit cache is safe.
2013-02-22 00:40:36 -08:00
Unknown W. Brackets
2bdc9dc491 Reset llBit on thread switch.
Never actually seen ll used, though... but this way it should
work as advertized, as long as a syscall doesn't happen in between...
2013-02-20 12:09:13 -08:00
Xele02
6339c2fc9a Correct crash when texture too small loaded in memory tex viewer
Correct current thread PC in the list.
2013-02-17 21:43:44 +01:00
Unknown W. Brackets
537fbe4d7d Minor perf gain in __KernelNextThread.
Just like .1% but was hoping Mr. Optimizer would do this for me.
2013-02-11 01:27:08 -08:00
Unknown W. Brackets
6ca1cad28c Add a std::vector wrapper to do remove/pop/push.
It showed up in a profile after all.  Cut down more than 1%.
2013-02-11 01:27:07 -08:00
Unknown W. Brackets
f552cb3370 Wake delayed threads directly, rather than looping.
This saves ~1% during fast forward on a release build.
2013-02-11 01:27:07 -08:00
Unknown W. Brackets
9a5589a180 Move running thread resched to __KernelNextThread.
Pretty sure this is needed, but apparently it breaks Sol Trigger.
2013-02-11 01:27:07 -08:00
Unknown W. Brackets
fd1c686edf Move currentThread init to a better place. 2013-02-11 01:27:06 -08:00
Xele02
69b837f18b Add debug dialogs (DisAsm, Memory, VFPU).
New features : Breakpoint display, thread status, display list status
Update translation and start french translation
2013-02-10 17:33:34 +01:00
Unknown W. Brackets
a5ba6821b7 Only switch to a started thread if better priority. 2013-02-09 19:02:38 -08:00
Unknown W. Brackets
0ff0b3f57d Return an error for invalid priority. 2013-02-09 19:01:25 -08:00
Unknown W. Brackets
161f2d712e sceKernelRotateThreadReadyQueue(0) means current. 2013-02-09 16:04:35 -08:00
Unknown W. Brackets
ddc93df61e Keep running threads at the top of the list.
There we go, this seems more right.  Switched to a std::list too.
2013-02-09 16:04:35 -08:00
Unknown W. Brackets
ea112fd9a6 Start the root thread as running, properly. 2013-02-09 16:04:34 -08:00
Unknown W. Brackets
b8ca8a44aa Fix completely wrong thread status switching.
Wow, kinda surprised this even worked...
But now things that use sceKernelRotateThreadReadyQueue are broken again.
2013-02-09 16:04:34 -08:00
Unknown W. Brackets
411c711dac Initial sceKernelRotateThreadReadyQueue().
Might not be right but it's closer.
Makes games that call this func much faster.
2013-02-09 16:04:34 -08:00
Sacha
e79c8e032a Buildfix for Blackberry, Meego. Optimisations to Qt build. 2013-02-07 14:41:02 +10:00
Unknown W. Brackets
112c1e9e23 Automatically delete pointers when savestating. 2013-02-04 08:28:22 -08:00