Commit Graph

83 Commits

Author SHA1 Message Date
Unknown W. Brackets
50e9e45d65 Check version in each DoState() func.
They bail on PointerWrap error or bad version.
2013-09-14 20:23:03 -07:00
Unknown W. Brackets
be468af52d Refactor waiting thread removal. 2013-09-09 00:22:00 -07:00
Unknown W. Brackets
4bd391b098 Refactor waiting thread cleanup. 2013-09-09 00:22:00 -07:00
Henrik Rydgard
8c88dff5a4 More log categories, use them (and existing ones). Improve log config. 2013-09-07 22:02:55 +02:00
Unknown W. Brackets
f35b164d11 Refactor wait verification a bit in kernel waits. 2013-09-07 10:54:00 -07:00
Unknown W. Brackets
b20bb3b609 Refactor down the begin/end callback stuff. 2013-09-03 01:21:52 -07:00
Unknown W. Brackets
1bf974aff6 Implement VPL/FPL callback handlers.
Smells like time to refactor, there are less differences than I expected.
2013-09-03 01:21:51 -07:00
Unknown W. Brackets
d547d2b391 Implement sceKernelCancelMutex(). 2013-08-25 16:38:49 -07:00
Unknown W. Brackets
008052e6d6 Fix some variable hiding warnings. 2013-08-12 23:32:38 -07:00
Unknown W. Brackets
81f7103e0b Use *_le for the sceKernel* funcs. 2013-07-25 08:04:34 -07:00
Unknown W. Brackets
bf652e4f46 Don't report for <= 4 sized option parameters.
Also don't crash in sceKernelCreateVTimer(NULL, NULL).
2013-07-07 21:16:28 -07:00
Unknown W. Brackets
933c8abb55 Check kernel object types when looking up ids.
Some games misuse it, need to return an error.
2013-06-18 23:54:29 -07:00
Unknown W. Brackets
aada48cf15 Use a PSPPointer in lwmutexes. 2013-06-02 15:17:24 -07:00
Unknown W. Brackets
77b0688d92 Recalculate numWaitThreads all the time.
Before, it could go negative by having a thread woken a second time
(e.g. because of a delete) before it actually scheduled and woke up.
2013-05-27 22:44:10 -07:00
Unknown W. Brackets
3fbc3bd14a Don't allow attr 0x400 for mutexes, report less.
Seems like 0 is ignored afaict, which makes sense from other funcs.
Not sure if anyone calls it with a value.
2013-05-18 15:31:31 -07:00
Unknown W. Brackets
9ce8c07530 Reschedule the timeout event on callback end.
Darn, missed that 3 times before I caught it.
2013-04-14 21:34:33 -07:00
Unknown W. Brackets
0918ec8598 Return negative for UnscheduleEvent().
It usually won't be, but it could be negative.

Also some other minor warnings.
2013-04-05 20:44:17 -07:00
Unknown W. Brackets
832edb0a8f Fix some x64 type conversion warnings. 2013-04-05 20:29:20 -07:00
Unknown W. Brackets
1cfdaa9349 Read structs directly from PSP ram on LE.
On BE, which doesn't even really work atm, this can be an auto class.
2013-03-30 20:12:22 -07:00
Unknown W. Brackets
52a8997006 These are actually okay, happen on the second cb. 2013-03-30 16:12:40 -07:00
Unknown W. Brackets
2ecc3157de Fix waits within waits for lwmutexes.
Also, it turns out sceKernelLockMutexCB() doesn't call callbacks on lock.
2013-03-30 16:12:39 -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
e4223dbcb0 Simplify adding report messages, add a bunch more. 2013-03-26 00:54:00 -07:00
Unknown W. Brackets
e133d33167 Don't re-wake a thread already woken by delete.
Arg, I thought I'd changed this already.
2013-03-24 22:54:09 -07:00
Unknown W. Brackets
da3af79f3b Turn down logging for LwMutexes.
No one seems to have run into issues with these for a while, and they are
quite noisy, since games use them as lightweight locks.
2013-03-10 22:57:27 -07:00
Unknown W. Brackets
37dffb6210 Implement sceKernelReferLwMutexStatus() and ByID(). 2013-02-24 22:50:48 -08:00
Unknown W. Brackets
ad3152cb94 Fix sceKernelReferMutexStatus(). 2013-02-24 20:28:39 -08:00
Unknown W. Brackets
2a6457b6ab Cut down on h files including PointerWrap.
This makes changes to it a bit faster to build.
2013-02-04 08:26:59 -08:00
Unknown W. Brackets
1cb7a88137 Don't use a dynamic string for wait debugging.
Happens in release, and shows up on the profiler.
Not huge, but should save ~0.5% of cpu time.
2013-01-26 11:29:19 -08:00
Henrik Rydgard
8d845cc588 quick implementation of sceKernelReferMutexStatus 2013-01-20 23:11:48 +01:00
Unknown W. Brackets
43c8726554 Oops, 0 is a valid timer id. 2013-01-18 01:38:14 -08:00
Unknown W. Brackets
305c41c932 Prevent duplicate waiting threads in sema/mutex.
If something did a tight loop of a short wait/timeout, it might end
up getting on the waitingThreads list multiple times.

Eventually this caused a massive performance problem.
2012-12-31 23:23:52 -08:00
Unknown W. Brackets
bcecd881b1 Savestate cleanup + be more careful with vectors.
For some reason I debugged it going into std::string so I just made
them all more explicit which fixed everything.
2012-12-28 13:55:31 -08:00
Unknown W. Brackets
3ed2045f6b Add state saving to tertiary kernel modules. 2012-12-28 13:55:25 -08:00
Unknown W. Brackets
595759ef78 Implement a factory for kernel objects.
Couldn't think of a better way to do this, maybe there's some fancy
one I don't know about.

Also finished up a couple left over kernel objects.

Maybe a quarter the way there?
2012-12-28 13:55:22 -08:00
Unknown W. Brackets
991243fffd Add basic DoState() to tertiary kernel objects. 2012-12-28 13:52:52 -08:00
Henrik Rydgård
b2f29992a3 Wrap some functions, clean some stuff 2012-12-26 08:52:40 +01:00
Unknown W. Brackets
9ba0ed46fd Always create CoreTiming timers during kernel init. 2012-12-23 21:27:26 -08:00
Unknown W. Brackets
65cfc8de86 Cleanup and fix mutex init, no need for a flag now. 2012-12-23 18:27:07 -08:00
Henrik Rydgård
4a4d126dc7 Init/shutdown mutex 2012-12-23 11:19:55 +01:00
Unknown W. Brackets
87fcdc9080 Use KERNELOBJECT_MAX_NAME_LENGTH for name length.
Just avoiding magic numbers, didn't know there was a constant.
2012-12-16 21:36:52 -08:00
Unknown W. Brackets
bb10140728 Oops, event flags weren't always deleting properly.
Added some comments to explain why removal from waitingThreads is
deferred.  Also had to move things around so the right outBitsPtr
is always written to on timeouts.
2012-12-15 01:36:53 -08:00
Unknown W. Brackets
67f7f6b05d Oops, these flags can be or'd together of course. 2012-12-14 23:24:04 -08:00
Unknown W. Brackets
2ea992f2c4 Validate attr for mutexes, semas, and events. 2012-12-14 12:05:15 -08:00
Unknown W. Brackets
3d57a4c838 Cleanup some wrappers now that rescheds defer. 2012-12-09 01:04:54 -08:00
Unknown W. Brackets
5e8aa4c071 Implement deferred rescheduling/callbacks.
This way most HLE functions can be wrapped normally.  Hurray, sanity.
2012-12-09 01:04:53 -08:00
Unknown W. Brackets
fda41752e8 Simplify the API for HLE funcs to do callbacks.
__KernelWaitCurThread() already (ultimately) calls __KernelCheckCallbacks.
2012-12-09 01:04:52 -08:00
Unknown W. Brackets
ee1a729157 Turns out *CB() fires even when it succeeds. 2012-12-09 01:04:50 -08:00
Unknown W. Brackets
f9b561ee42 Implement priority unlocking for mutexes. 2012-12-09 01:04:49 -08:00
Unknown W. Brackets
a67505761e Mutexes and semaphores were rescheduling twice.
This was causing it to "jump" the correct thread and go to the next.
2012-12-07 00:46:18 -08:00