mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 12:10:59 +12:00
Add SendSyncRequest
This commit is contained in:
parent
0e66af8dae
commit
ee74b375e3
3 changed files with 23 additions and 1 deletions
|
@ -43,7 +43,7 @@ void Kernel::connectToPort() {
|
|||
}
|
||||
|
||||
const auto portHandle = getPortHandle(port);
|
||||
if (!portHandle.has_value()) {
|
||||
if (!portHandle.has_value()) [[unlikely]] {
|
||||
Helpers::panic("ConnectToPort: Port doesn't exist\n");
|
||||
regs[0] = SVCResult::ObjectNotFound;
|
||||
return;
|
||||
|
@ -52,6 +52,26 @@ void Kernel::connectToPort() {
|
|||
// TODO: Actually create session
|
||||
Handle sessionHandle = makeObject(KernelObjectType::Session);
|
||||
|
||||
// TODO: Should the result be written back to [r0]?
|
||||
regs[0] = SVCResult::Success;
|
||||
regs[1] = sessionHandle;
|
||||
}
|
||||
|
||||
// Result SendSyncRequest(Handle session)
|
||||
void Kernel::sendSyncRequest() {
|
||||
const auto handle = regs[0];
|
||||
const auto session = getObject(handle, KernelObjectType::Session);
|
||||
printf("SendSyncRequest(session handle = %d)\n", handle);
|
||||
|
||||
if (session == nullptr) [[unlikely]] {
|
||||
Helpers::panic("SendSyncRequest: Invalid session handle");
|
||||
regs[0] = SVCResult::BadHandle;
|
||||
return;
|
||||
}
|
||||
|
||||
const auto sessionData = static_cast<SessionData*>(session->data);
|
||||
const u32 messagePointer = VirtualAddrs::TLSBase + 0x80;
|
||||
|
||||
Helpers::panic("SendSyncRequest: Message header: %08X", mem.read32(messagePointer));
|
||||
regs[0] = SVCResult::Success;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue