mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
IOS: Simplify IPC initialisation
The extra IPC ack is triggered by a syscall that is invoked in ES's main function; the syscall literally just sets Y2, IX1 and IX2 in HW_IPC_ARMCTRL -- there is no complicated ack queue or anything.
This commit is contained in:
@ -64,7 +64,6 @@ namespace IOS::HLE
|
||||
static std::unique_ptr<EmulationKernel> s_ios;
|
||||
|
||||
constexpr u64 ENQUEUE_REQUEST_FLAG = 0x100000000ULL;
|
||||
constexpr u64 ENQUEUE_ACKNOWLEDGEMENT_FLAG = 0x200000000ULL;
|
||||
static CoreTiming::EventType* s_event_enqueue;
|
||||
static CoreTiming::EventType* s_event_sdio_notify;
|
||||
static CoreTiming::EventType* s_event_finish_ppc_bootstrap;
|
||||
@ -289,9 +288,6 @@ EmulationKernel::EmulationKernel(u64 title_id) : Kernel(title_id)
|
||||
return;
|
||||
}
|
||||
|
||||
// IOS re-inits IPC and sends a dummy ack during its boot process.
|
||||
EnqueueIPCAcknowledgement(0);
|
||||
|
||||
AddCoreDevices();
|
||||
AddStaticDevices();
|
||||
}
|
||||
@ -443,6 +439,15 @@ bool Kernel::BootIOS(const u64 ios_title_id, const std::string& boot_content_pat
|
||||
return true;
|
||||
}
|
||||
|
||||
void Kernel::InitIPC()
|
||||
{
|
||||
if (s_ios == nullptr)
|
||||
return;
|
||||
|
||||
INFO_LOG_FMT(IOS, "IPC initialised.");
|
||||
GenerateAck(0);
|
||||
}
|
||||
|
||||
void Kernel::AddDevice(std::unique_ptr<Device> device)
|
||||
{
|
||||
ASSERT(device->GetDeviceType() == Device::DeviceType::Static);
|
||||
@ -690,17 +695,9 @@ void Kernel::EnqueueIPCReply(const Request& request, const s32 return_value, s64
|
||||
CoreTiming::ScheduleEvent(cycles_in_future, s_event_enqueue, request.address, from);
|
||||
}
|
||||
|
||||
void Kernel::EnqueueIPCAcknowledgement(u32 address, int cycles_in_future)
|
||||
{
|
||||
CoreTiming::ScheduleEvent(cycles_in_future, s_event_enqueue,
|
||||
address | ENQUEUE_ACKNOWLEDGEMENT_FLAG);
|
||||
}
|
||||
|
||||
void Kernel::HandleIPCEvent(u64 userdata)
|
||||
{
|
||||
if (userdata & ENQUEUE_ACKNOWLEDGEMENT_FLAG)
|
||||
m_ack_queue.push_back(static_cast<u32>(userdata));
|
||||
else if (userdata & ENQUEUE_REQUEST_FLAG)
|
||||
if (userdata & ENQUEUE_REQUEST_FLAG)
|
||||
m_request_queue.push_back(static_cast<u32>(userdata));
|
||||
else
|
||||
m_reply_queue.push_back(static_cast<u32>(userdata));
|
||||
@ -730,14 +727,6 @@ void Kernel::UpdateIPC()
|
||||
m_reply_queue.pop_front();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_ack_queue.empty())
|
||||
{
|
||||
GenerateAck(m_ack_queue.front());
|
||||
WARN_LOG_FMT(IOS, "<<-- Double-ack to IPC Request @ {:#010x}", m_ack_queue.front());
|
||||
m_ack_queue.pop_front();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Kernel::UpdateDevices()
|
||||
|
Reference in New Issue
Block a user