Yuri Kunde Schlesner
a5eba2f984
Kernel: Remove g_program_id
This has been obsoleted by the field in Process.
11 years ago
Yuri Kunde Schlesner
6d60acf0f1
Kernel: Introduce skeleton Process class to hold process data
11 years ago
Yuri Kunde Schlesner
e1fbac3ca1
Common: Remove common.h
11 years ago
Yuri Kunde Schlesner
c916bcf7b5
Move typedefs from kernel.h to more appropriate places
11 years ago
bunnei
c7dc799e19
Kernel: Properly initialize and shutdown all modules.
11 years ago
Emmanuel Gil Peyrot
0d69b2f7bd
Kernel: Use the correct format string for u64 hex.
11 years ago
bunnei
c077bcefa9
SVC: Update various SVCs to cause a reschedule.
- CreateMutex/ReleaseMutex/ReleaseSemaphore/SetTimer/CancelTimer/ArbitrateAddress
11 years ago
bunnei
9c3419ebcc
Kernel: Implemented priority inheritance for mutexes.
11 years ago
bunnei
7b9f428b23
Thread: Implement priority boost for starved threads.
SVC: Return correct error code on invalid CreateThread processor ID.
SVC: Assert when creating a thread with an invalid userland priority.
11 years ago
bunnei
e08f55b1a7
Kernel: Fixed default thread priority.
11 years ago
Gareth Higgins
25a43cd2ec
Initialize base address to 0x0
11 years ago
archshift
4fb75d220a
Misc cleanup of common and related functions
11 years ago
Subv
8e2b248e05
Build: Fixed some warnings
11 years ago
archshift
ef24e72b26
Asserts: break/crash program, fit to style guide; log.h->assert.h
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)
Also removed some GEKKO cruft.
11 years ago
Kevin Hartman
5fcbfc06eb
Scheduler refactor Pt. 1
* Simplifies scheduling logic, specifically regarding thread status. It should be much clearer which statuses are valid
for a thread at any given point in the system.
* Removes dead code from thread.cpp.
* Moves the implementation of resetting a ThreadContext to the corresponding core's implementation.
Other changes:
* Fixed comments in arm interfaces.
* Updated comments in thread.cpp
* Removed confusing, useless, functions like MakeReady() and ChangeStatus() from thread.cpp.
* Removed stack_size from Thread. In the CTR kernel, the thread's stack would be allocated before thread creation.
11 years ago
bunnei
1b0bf00cbc
Mutex: Locks should be recursive.
11 years ago
Lioncash
676daef3c7
core: Fix some warnings on OSX
11 years ago
Yuri Kunde Schlesner
88a4a808c6
Kernel: Stop creating useless Handles during object creation
They're finally unnecessary, and will stop cluttering the application's
handle table.
11 years ago
Yuri Kunde Schlesner
52f58e64ef
Kernel: Make WaitObjects share ownership of Threads waiting on them
During normal operation, a thread waiting on an WaitObject and the
object hold mutual references to each other for the duration of the
wait.
If a process is forcefully terminated (The CTR kernel has a SVC to do
this, TerminateProcess, though no equivalent exists for threads.) its
threads would also be stopped and destroyed, leaving dangling pointers
in the WaitObjects.
The solution is to simply have the Thread remove itself from WaitObjects
when it is stopped. The vector of Threads in WaitObject has also been
changed to hold SharedPtrs, just in case. (Better to have a reference
cycle than a crash.)
11 years ago
Yuri Kunde Schlesner
7725256f64
Explicitly instantiate constructors/destructors for Kernel objects
This should speed up compile times a bit, as well as enable more liberal
use of forward declarations. (Due to SharedPtr not trying to emit the
destructor anymore.)
11 years ago
Yuri Kunde Schlesner
4e84df8be3
Mutex: Replace g_mutex_held_locks with a set inside Thread
11 years ago
Yuri Kunde Schlesner
e8330dd162
Kernel: Fix bug in HandleTable::Close
11 years ago
Yuri Kunde Schlesner
5354a479bc
Kernel: Remove Object::GetHandle (it's not used anymore :D)
11 years ago
Yuri Kunde Schlesner
869ec46683
Kernel: Introduce unique Object ids for debugging
11 years ago
Yuri Kunde Schlesner
a9b86db3cf
Kernel: Use separate Handle tables for CoreTiming userdata
This is to support the removal of GetHandle soon
11 years ago
Yuri Kunde Schlesner
ec9c773251
Kernel: Remove previous scheduled event when a Timer is re-Set
11 years ago
Yuri Kunde Schlesner
664c79ff47
Thread: Modernize two functions that slipped through previous rebases
11 years ago
Lioncash
3f00dd9117
arm: Clean up ARMul_State
Remove unnecessary/unused struct variables.
11 years ago
Lioncash
96c174aed4
shared_memory: Fix assignments in SharedMemory::Map
11 years ago
Yuri Kunde Schlesner
d917a9bf77
Kernel: Mark all appropriate kernel objects as "final"
11 years ago
Yuri Kunde Schlesner
09ae6e1fa3
Remove result.h InvalidHandle
It was only being used in two places, where it was replaced by a local
constant.
11 years ago
Yuri Kunde Schlesner
d52d859936
Kernel: Convert Event to not use Handles
11 years ago
Yuri Kunde Schlesner
ad80ff1e32
Kernel: Convert Timer to (mostly) not use Handles
11 years ago
Yuri Kunde Schlesner
882b6fed75
Kernel: Convert Mutex to not use Handles
11 years ago
Yuri Kunde Schlesner
38e7122f23
Kernel: Convert AddressArbiter to not use Handles
11 years ago
Yuri Kunde Schlesner
d9b19be1d9
Kernel: Convert Semaphore to not use Handles
11 years ago
Yuri Kunde Schlesner
4bb33dfc30
Kernel: Convert SharedMemory to not use Handles
11 years ago
Yuri Kunde Schlesner
b5ee4f9df9
Move VAddr/PAddr typedefs to kernel.h
11 years ago
Yuri Kunde Schlesner
9a345de2bd
Kernel: Remove useless/duplicated comments; mark functions static
11 years ago
bunnei
68ddaaa2f5
Thread: Fix WaitSynchronization1 to not set register 1 on thread wakeup.
11 years ago
bunnei
4255f25647
Thread: Use std::find in CheckWait_WaitObject.
11 years ago
bunnei
2f3020a102
Mutex: Cleanup and remove redundant code.
11 years ago
bunnei
f09806aed2
Kernel: Renamed some functions for clarity.
- ReleaseNextThread->WakeupNextThread
- ReleaseAllWaitingThreads->WakeupAllWaitingThreads.
11 years ago
bunnei
15b6a4d9ad
Kernel: Changed "ShouldWait" to return bool and "Acquire" to return void.
11 years ago
bunnei
c68eb15695
WaitObject: Renamed "Wait" to "ShouldWait", made "ShouldWait" and "Acquire" pure virtual.
11 years ago
bunnei
69c5830ef2
Event: Fix implementation of "non-sticky" events.
11 years ago
bunnei
9e6ec3b6cd
Session: Change to a WaitObject.
11 years ago
bunnei
d2759c578e
Kernel: Reschedule on SignalEvent and SendSyncRequest, fix some bugs.
11 years ago
bunnei
dde02f79af
Mutex: Fix a bug where the thread should not wait if it already has the mutex.
11 years ago
bunnei
9412996c8f
Kernel: Moved Wait and Acquire to WaitObject, added way to retrieve a WaitObject safely.
11 years ago