Commit Graph

4450 Commits

Author SHA1 Message Date
James Benton
412a98f33a gx2: Fix GX2DrawIndexEx usage of GX2IndexType. 2016-06-02 13:02:47 -07:00
Brett Lawson
c898fb2140 Moved active-thread management to coreinit. 2016-06-02 13:02:47 -07:00
James Benton
92970c7931 First (semi-working) attempt at moving scheduling to coreinit. 2016-06-02 13:02:47 -07:00
James Benton
1d80ac0282 Refactor coreinit_internal_queue and OSThreadQueue. 2016-06-02 13:02:46 -07:00
Brett Lawson
e95ac254d0 Started working on moving scheduling into coreinit. 2016-06-02 13:02:46 -07:00
Brett Lawson
3e1d9781b3 Update all Alarm handling to more closely match the WiiU.
Our old alarm handling behaviour was vastly different from
the WiiU hardware, this commit (mostly) gets us on-par.
2016-06-02 13:02:45 -07:00
James Benton
6c4f457977 Fix build for StackObject. 2016-06-02 13:02:45 -07:00
James Benton
a8e75dfcbf gx2: Update GX2WaitTimeStamp to use new reschedules. 2016-06-02 13:02:44 -07:00
James Benton
95738b11e4 coreinit: Update MPTaskQueue functions to use new reschedules. 2016-06-02 13:02:44 -07:00
James Benton
9f72d6af96 coreinit: Update OSSemaphore functions to use new reschedules. 2016-06-02 13:02:43 -07:00
James Benton
47ab306415 coreinit: Update OSMutex functions to use new reschedules. 2016-06-02 13:02:43 -07:00
James Benton
2e10fc6c2c coreinit: Update OSMessageQueue functions to use new reschedules. 2016-06-02 13:02:42 -07:00
James Benton
f2d82d4944 coreinit: Update OSEvent functions to use new reschedules. 2016-06-02 13:02:42 -07:00
James Benton
2317deb1e4 coreinit: Update OSAlarm functions to use IdLock and new reschedules. 2016-06-02 13:02:42 -07:00
James Benton
ac35ce1179 coreinit: Update OSThread functions to use new reschedules. 2016-06-02 13:02:41 -07:00
James Benton
65b0bd0956 coreinit: Introduce new core reschedule functions.
These allow us to reschedule specific cores.
2016-06-02 13:02:41 -07:00
James Benton
4dda89c43a coreinit: Add alarmCancelled and waitEventTimeoutAlarm to OSThread.
These are to be used for avoiding race conditions in OSEvent and OSAlarm.
2016-06-02 13:02:40 -07:00
James Benton
352a79901b coreinit: Update atomic64 to use IdLock. 2016-06-02 13:02:40 -07:00
James Benton
7c73886066 coreinit: Add coreinit::internal::IdLock.
This is a simple spin lock which does nothing fancy.
2016-06-02 13:02:39 -07:00
James Benton
2c3e4ae73c Do not cause scheduling interrupts when a thread is queued. 2016-06-02 13:02:39 -07:00
James Benton
6ebe4d65e2 Rename kernel::rescheduleNoLock to kernel::checkActiveThread.
Reschedule is for another purpose!
2016-06-02 13:02:38 -07:00
Brett Lawson
dd9b3d8e47 Added StackObject class for allocating on PPC stack. 2016-06-02 13:02:38 -07:00
Brett Lawson
2ed7c3e318 OSPrintCurrentThreadState is an actual coreinit function. 2016-06-02 13:02:38 -07:00
James
f95f397462 Add missing cmath include to interpreter_float 2016-06-02 13:02:37 -07:00
Brett Lawson
cfbd69d1c2 Fixed a deadlock with OSWaitAlarm between sAlarmLock and scheduler. 2016-06-02 13:02:37 -07:00
Brett Lawson
2447b51103 Insert padding into display list alignment space.
This fixes an issue where we were receiving garbage data
in the pm4 parser at the gpu side.
2016-06-02 13:02:28 -07:00
Brett Lawson
f8b4b0e516 Add validation logic to type3 packet serialization that size > 2.
See last commit for more information on why we need this.
2016-06-01 00:44:27 -07:00
Brett Lawson
1ebfbf1227 Add a dummy field to DecafSwapBuffers to comply with type3 pm4.
PM4 Type3 Packets are required to have a dword size included in their
header.  This size actually assumes that no packet will be empty, so
1 dword is size 0...  This means a size 0 packet was being encoded as
0xFFFF words in size, essentially nulling out the rest of the command
stream by 'reading' it.  A recent change has made this obvious by
detecting that the stream isn't even long enough for that.
2016-06-01 00:40:17 -07:00
Brett Lawson
0ba3e7c8af Fix minor logic error in pm4 packet copying logic. 2016-06-01 00:21:20 -07:00
Brett Lawson
3b00e9a93a Correct minor off-by-one comparison error in PM4 processing. 2016-06-01 00:03:24 -07:00
Brett Lawson
958c069b73 Strongly type REG_OFFSET and CONST_OFFSET to their respective types. 2016-06-01 00:02:17 -07:00
Brett Lawson
b3bffeeadf Don't take the scheduler lock while executing alarms. 2016-05-31 22:03:54 -07:00
Brett Lawson
ad69f4b71e Do not recursively lock the alarm lock when updating the cpu alarm. 2016-05-31 22:03:49 -07:00
James Benton
c035e9400e Do not print char* as a string.
It can be used as temporary buffer and bad things happen.
2016-05-31 23:51:20 +01:00
James Benton
c133342ea7 pm4: Explicitly use REG_OFFSET and CONST_OFFSET in pm4 structures. 2016-05-31 23:51:20 +01:00
Brett Lawson
e3b724492a Fix a wierd include that was in cpu.h 2016-05-31 10:23:05 -07:00
Brett Lawson
99ad329b17 Implement some GHS thread-local-storage stuff. 2016-05-31 10:22:59 -07:00
Brett Lawson
367b743a5d Fix issue with tracing not being set up during thread switches. 2016-05-31 05:45:16 -07:00
Brett Lawson
a32be2a8a0 Release the AlarmLock before attempting to signal other threads. 2016-05-31 05:25:52 -07:00
James Benton
95031b033f vcxproj: Fix missing coreinit_interrupts files. 2016-05-31 17:15:49 +01:00
James Benton
f48238e3b7 cmake: Add coreinit_interrupts to CMakeLists 2016-05-31 05:13:20 -07:00
James Benton
60dae4eb0b coreinit: Fix uninterruptible spinlock not disabling interrupts.
Also implement spinlock with timeout.
2016-05-31 13:11:37 +01:00
James Benton
80edc47bb6 coreinit: Implement set/get interrupt functions.
OSEnableInterrupts, OSDisableInterrupts, OSRestoreInterrupts,
OSIsInterruptEnabled.
2016-05-31 13:11:37 +01:00
James Benton
cf90008771 cpu: Add support for enable / disable of interrupts. 2016-05-31 13:11:37 +01:00
James Benton
97382703ba Add src/kernel/CMakeLists.txt 2016-05-31 04:36:45 -07:00
James Benton
f1eb065bb5 Fix CMakeLists 2016-05-31 04:17:07 -07:00
James Benton
21a3e0e3a4 Fix CPU state using non-standard std::atomic_uint32_t.
Use std::atomic<uint32_t> instead.
2016-05-31 04:16:58 -07:00
James Benton
a6442eead2 Add missing include to cpu.cpp 2016-05-31 04:16:23 -07:00
Brett Lawson
16beb53d4b Fix issue where Vsync Callback assumed it had a scheduler lock.
This was an oddity from the old alarm handler which actually
held the scheduler lock when it called callbacks (which was
obviously dangerous *points at James*).
2016-05-31 03:49:53 -07:00
James Benton
cc0093ab03 gx2: Fix missing DATA_FORMAT from GX2InitTextureRegs. 2016-05-31 11:50:18 +01:00