mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 14:57:41 -05:00
Merge pull request #4491 from lioncash/unused-vars
kernel: Remove unused variables
This commit is contained in:
commit
acfd771e79
2 changed files with 11 additions and 18 deletions
|
@ -604,7 +604,6 @@ ResultCode PageTable::MapPages(VAddr addr, const PageLinkedList& page_linked_lis
|
||||||
if (const auto result{
|
if (const auto result{
|
||||||
Operate(cur_addr, node.GetNumPages(), perm, OperationType::Map, node.GetAddress())};
|
Operate(cur_addr, node.GetNumPages(), perm, OperationType::Map, node.GetAddress())};
|
||||||
result.IsError()) {
|
result.IsError()) {
|
||||||
const MemoryInfo info{block_manager->FindBlock(cur_addr).GetMemoryInfo()};
|
|
||||||
const std::size_t num_pages{(addr - cur_addr) / PageSize};
|
const std::size_t num_pages{(addr - cur_addr) / PageSize};
|
||||||
|
|
||||||
ASSERT(
|
ASSERT(
|
||||||
|
|
|
@ -664,32 +664,26 @@ void Scheduler::Reload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scheduler::SwitchContextStep2() {
|
void Scheduler::SwitchContextStep2() {
|
||||||
Thread* previous_thread = current_thread_prev.get();
|
|
||||||
Thread* new_thread = selected_thread.get();
|
|
||||||
|
|
||||||
// Load context of new thread
|
// Load context of new thread
|
||||||
Process* const previous_process =
|
if (selected_thread) {
|
||||||
previous_thread != nullptr ? previous_thread->GetOwnerProcess() : nullptr;
|
ASSERT_MSG(selected_thread->GetSchedulingStatus() == ThreadSchedStatus::Runnable,
|
||||||
|
|
||||||
if (new_thread) {
|
|
||||||
ASSERT_MSG(new_thread->GetSchedulingStatus() == ThreadSchedStatus::Runnable,
|
|
||||||
"Thread must be runnable.");
|
"Thread must be runnable.");
|
||||||
|
|
||||||
// Cancel any outstanding wakeup events for this thread
|
// Cancel any outstanding wakeup events for this thread
|
||||||
new_thread->SetIsRunning(true);
|
selected_thread->SetIsRunning(true);
|
||||||
new_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
|
selected_thread->last_running_ticks = system.CoreTiming().GetCPUTicks();
|
||||||
new_thread->SetWasRunning(false);
|
selected_thread->SetWasRunning(false);
|
||||||
|
|
||||||
auto* const thread_owner_process = current_thread->GetOwnerProcess();
|
auto* const thread_owner_process = current_thread->GetOwnerProcess();
|
||||||
if (thread_owner_process != nullptr) {
|
if (thread_owner_process != nullptr) {
|
||||||
system.Kernel().MakeCurrentProcess(thread_owner_process);
|
system.Kernel().MakeCurrentProcess(thread_owner_process);
|
||||||
}
|
}
|
||||||
if (!new_thread->IsHLEThread()) {
|
if (!selected_thread->IsHLEThread()) {
|
||||||
Core::ARM_Interface& cpu_core = new_thread->ArmInterface();
|
Core::ARM_Interface& cpu_core = selected_thread->ArmInterface();
|
||||||
cpu_core.LoadContext(new_thread->GetContext32());
|
cpu_core.LoadContext(selected_thread->GetContext32());
|
||||||
cpu_core.LoadContext(new_thread->GetContext64());
|
cpu_core.LoadContext(selected_thread->GetContext64());
|
||||||
cpu_core.SetTlsAddress(new_thread->GetTLSAddress());
|
cpu_core.SetTlsAddress(selected_thread->GetTLSAddress());
|
||||||
cpu_core.SetTPIDR_EL0(new_thread->GetTPIDR_EL0());
|
cpu_core.SetTPIDR_EL0(selected_thread->GetTPIDR_EL0());
|
||||||
cpu_core.ChangeProcessorID(this->core_id);
|
cpu_core.ChangeProcessorID(this->core_id);
|
||||||
cpu_core.ClearExclusiveState();
|
cpu_core.ClearExclusiveState();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue