Unknown W. Brackets
0ad9658eb2
Increment wakeupCount when a thread is pending.
...
It might've been woken up but just not run yet. That doesn't mean
it should not have wakeupCount incremented.
Fixes Tales of Eternia freezing before world map.
2013-04-13 00:35:24 -07:00
Henrik Rydgård
b5b13c6ab5
Merge pull request #1251 from unknownbrackets/module-minor
...
Cleanup sceKernelGetModuleIdByAddress()
2013-04-11 00:45:42 -07:00
Unknown W. Brackets
5aceceecd3
Remove global module id var hacks.
...
Nothing needs them anymore.
2013-04-10 21:16:31 -07:00
Unknown W. Brackets
1f1560a9d6
Don't mark sceKernelExitThread() as an error.
...
Also, add some reporting and make the sceKernelCreateThread log message
shorter.
2013-04-09 23:23:10 -07:00
Unknown W. Brackets
5e14cab945
Don't save vregs for threads that don't use them.
2013-04-07 11:47:00 -07:00
Unknown W. Brackets
c7020d4872
Optimize resched with a running thread.
...
Esp. if it would go back to itself.
2013-04-07 11:47:00 -07:00
Unknown W. Brackets
68f5596dee
Fix crash if queue is empty during savestate.
...
On load it would then crash.
2013-04-07 10:32:39 -07:00
Unknown W. Brackets
da2d5f0692
Dynamically size the thread queue, explicitly alloc.
2013-04-07 10:27:29 -07:00
Unknown W. Brackets
2ee611de09
Replace the thread ready queue with non-STL.
...
It seems much faster.
2013-04-07 03:10:14 -07:00
Unknown W. Brackets
4cd260a2fc
Centralize the thread ready queue logic.
...
This makes it slower for now, but should make it easier to optimize correctly.
2013-04-07 03:09:23 -07:00
Unknown W. Brackets
65ac7389d7
Don't get stuck on idle when interrupts run.
...
This was happening when the dispatch thread was disabled.
2013-04-06 17:04:20 -07:00
Unknown W. Brackets
2367c17735
Don't suspend/resume dispatch while interrupts off.
2013-04-06 17:04:18 -07:00
Unknown W. Brackets
8f17cef95b
Stop threadend timeout when the thread ends.
...
Fixes threads waking up early in tests.
2013-04-06 17:04:16 -07:00
Unknown W. Brackets
c57954a72e
Implement sceGeDrawSync().
2013-04-06 02:30:37 -07:00
Unknown W. Brackets
72921e0a3c
If the mipscall id doesn't match, don't create.
...
Fixes a crash when savestating.
2013-03-31 12:09:59 -07:00
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