diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 32 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.h | 47 |
2 files changed, 75 insertions, 4 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 40922ec3a..12954556d 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -155,7 +155,7 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger | |||
| 155 | RegisterHandlers(functions); | 155 | RegisterHandlers(functions); |
| 156 | 156 | ||
| 157 | launchable_event = | 157 | launchable_event = |
| 158 | Kernel::Event::Create(Kernel::ResetType::OneShot, "ISelfController:LaunchableEvent"); | 158 | Kernel::Event::Create(Kernel::ResetType::Sticky, "ISelfController:LaunchableEvent"); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) { | 161 | void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) { |
| @@ -436,13 +436,13 @@ public: | |||
| 436 | static const FunctionInfo functions[] = { | 436 | static const FunctionInfo functions[] = { |
| 437 | {0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"}, | 437 | {0, &ILibraryAppletAccessor::GetAppletStateChangedEvent, "GetAppletStateChangedEvent"}, |
| 438 | {1, nullptr, "IsCompleted"}, | 438 | {1, nullptr, "IsCompleted"}, |
| 439 | {10, nullptr, "Start"}, | 439 | {10, &ILibraryAppletAccessor::Start, "Start"}, |
| 440 | {20, nullptr, "RequestExit"}, | 440 | {20, nullptr, "RequestExit"}, |
| 441 | {25, nullptr, "Terminate"}, | 441 | {25, nullptr, "Terminate"}, |
| 442 | {30, nullptr, "GetResult"}, | 442 | {30, &ILibraryAppletAccessor::GetResult, "GetResult"}, |
| 443 | {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, | 443 | {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, |
| 444 | {100, &ILibraryAppletAccessor::PushInData, "PushInData"}, | 444 | {100, &ILibraryAppletAccessor::PushInData, "PushInData"}, |
| 445 | {101, nullptr, "PopOutData"}, | 445 | {101, &ILibraryAppletAccessor::PopOutData, "PopOutData"}, |
| 446 | {102, nullptr, "PushExtraStorage"}, | 446 | {102, nullptr, "PushExtraStorage"}, |
| 447 | {103, nullptr, "PushInteractiveInData"}, | 447 | {103, nullptr, "PushInteractiveInData"}, |
| 448 | {104, nullptr, "PopInteractiveOutData"}, | 448 | {104, nullptr, "PopInteractiveOutData"}, |
| @@ -470,6 +470,20 @@ private: | |||
| 470 | NGLOG_WARNING(Service_AM, "(STUBBED) called"); | 470 | NGLOG_WARNING(Service_AM, "(STUBBED) called"); |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | void GetResult(Kernel::HLERequestContext& ctx) { | ||
| 474 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 475 | rb.Push(RESULT_SUCCESS); | ||
| 476 | |||
| 477 | NGLOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 478 | } | ||
| 479 | |||
| 480 | void Start(Kernel::HLERequestContext& ctx) { | ||
| 481 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 482 | rb.Push(RESULT_SUCCESS); | ||
| 483 | |||
| 484 | NGLOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 485 | } | ||
| 486 | |||
| 473 | void PushInData(Kernel::HLERequestContext& ctx) { | 487 | void PushInData(Kernel::HLERequestContext& ctx) { |
| 474 | IPC::RequestParser rp{ctx}; | 488 | IPC::RequestParser rp{ctx}; |
| 475 | storage_stack.push(rp.PopIpcInterface<AM::IStorage>()); | 489 | storage_stack.push(rp.PopIpcInterface<AM::IStorage>()); |
| @@ -480,6 +494,16 @@ private: | |||
| 480 | NGLOG_DEBUG(Service_AM, "called"); | 494 | NGLOG_DEBUG(Service_AM, "called"); |
| 481 | } | 495 | } |
| 482 | 496 | ||
| 497 | void PopOutData(Kernel::HLERequestContext& ctx) { | ||
| 498 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 499 | rb.Push(RESULT_SUCCESS); | ||
| 500 | rb.PushIpcInterface<AM::IStorage>(std::move(storage_stack.top())); | ||
| 501 | |||
| 502 | storage_stack.pop(); | ||
| 503 | |||
| 504 | NGLOG_DEBUG(Service_AM, "called"); | ||
| 505 | } | ||
| 506 | |||
| 483 | std::stack<std::shared_ptr<AM::IStorage>> storage_stack; | 507 | std::stack<std::shared_ptr<AM::IStorage>> storage_stack; |
| 484 | Kernel::SharedPtr<Kernel::Event> state_changed_event; | 508 | Kernel::SharedPtr<Kernel::Event> state_changed_event; |
| 485 | }; | 509 | }; |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h index 2ecf818f3..56b5ed60d 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h | |||
| @@ -26,11 +26,19 @@ public: | |||
| 26 | private: | 26 | private: |
| 27 | enum class IoctlCommand : u32_le { | 27 | enum class IoctlCommand : u32_le { |
| 28 | IocSetNVMAPfdCommand = 0x40044801, | 28 | IocSetNVMAPfdCommand = 0x40044801, |
| 29 | IocAllocGPFIFOCommand = 0x40084805, | ||
| 29 | IocSetClientDataCommand = 0x40084714, | 30 | IocSetClientDataCommand = 0x40084714, |
| 30 | IocGetClientDataCommand = 0x80084715, | 31 | IocGetClientDataCommand = 0x80084715, |
| 31 | IocZCullBind = 0xc010480b, | 32 | IocZCullBind = 0xc010480b, |
| 32 | IocSetErrorNotifierCommand = 0xC018480C, | 33 | IocSetErrorNotifierCommand = 0xC018480C, |
| 33 | IocChannelSetPriorityCommand = 0x4004480D, | 34 | IocChannelSetPriorityCommand = 0x4004480D, |
| 35 | IocEnableCommand = 0x0000480E, | ||
| 36 | IocDisableCommand = 0x0000480F, | ||
| 37 | IocPreemptCommand = 0x00004810, | ||
| 38 | IocForceResetCommand = 0x00004811, | ||
| 39 | IocEventIdControlCommand = 0x40084812, | ||
| 40 | IocGetErrorNotificationCommand = 0xC0104817, | ||
| 41 | IocAllocGPFIFOExCommand = 0x40204818, | ||
| 34 | IocAllocGPFIFOEx2Command = 0xC020481A, | 42 | IocAllocGPFIFOEx2Command = 0xC020481A, |
| 35 | IocAllocObjCtxCommand = 0xC0104809, | 43 | IocAllocObjCtxCommand = 0xC0104809, |
| 36 | IocChannelGetWaitbaseCommand = 0xC0080003, | 44 | IocChannelGetWaitbaseCommand = 0xC0080003, |
| @@ -56,6 +64,12 @@ private: | |||
| 56 | }; | 64 | }; |
| 57 | static_assert(sizeof(IoctlChannelSetTimeout) == 4, "IoctlChannelSetTimeout is incorrect size"); | 65 | static_assert(sizeof(IoctlChannelSetTimeout) == 4, "IoctlChannelSetTimeout is incorrect size"); |
| 58 | 66 | ||
| 67 | struct IoctlAllocGPFIFO { | ||
| 68 | u32_le num_entries; | ||
| 69 | u32_le flags; | ||
| 70 | }; | ||
| 71 | static_assert(sizeof(IoctlAllocGPFIFO) == 8, "IoctlAllocGPFIFO is incorrect size"); | ||
| 72 | |||
| 59 | struct IoctlClientData { | 73 | struct IoctlClientData { |
| 60 | u64_le data; | 74 | u64_le data; |
| 61 | }; | 75 | }; |
| @@ -76,12 +90,45 @@ private: | |||
| 76 | }; | 90 | }; |
| 77 | static_assert(sizeof(IoctlSetErrorNotifier) == 24, "IoctlSetErrorNotifier is incorrect size"); | 91 | static_assert(sizeof(IoctlSetErrorNotifier) == 24, "IoctlSetErrorNotifier is incorrect size"); |
| 78 | 92 | ||
| 93 | struct IoctlChannelSetPriority { | ||
| 94 | u32_le priority; | ||
| 95 | }; | ||
| 96 | static_assert(sizeof(IoctlChannelSetPriority) == 4, | ||
| 97 | "IoctlChannelSetPriority is incorrect size"); | ||
| 98 | |||
| 99 | struct IoctlEventIdControl { | ||
| 100 | u32_le cmd; // 0=disable, 1=enable, 2=clear | ||
| 101 | u32_le id; | ||
| 102 | }; | ||
| 103 | static_assert(sizeof(IoctlEventIdControl) == 8, "IoctlEventIdControl is incorrect size"); | ||
| 104 | |||
| 105 | struct IoctlGetErrorNotification { | ||
| 106 | u64_le timestamp; | ||
| 107 | u32_le info32; | ||
| 108 | u16_le info16; | ||
| 109 | u16_le status; // always 0xFFFF | ||
| 110 | }; | ||
| 111 | static_assert(sizeof(IoctlGetErrorNotification) == 16, | ||
| 112 | "IoctlGetErrorNotification is incorrect size"); | ||
| 113 | |||
| 79 | struct IoctlFence { | 114 | struct IoctlFence { |
| 80 | u32_le id; | 115 | u32_le id; |
| 81 | u32_le value; | 116 | u32_le value; |
| 82 | }; | 117 | }; |
| 83 | static_assert(sizeof(IoctlFence) == 8, "IoctlFence is incorrect size"); | 118 | static_assert(sizeof(IoctlFence) == 8, "IoctlFence is incorrect size"); |
| 84 | 119 | ||
| 120 | struct IoctlAllocGpfifoEx { | ||
| 121 | u32_le num_entries; | ||
| 122 | u32_le flags; | ||
| 123 | u32_le unk0; | ||
| 124 | u32_le unk1; | ||
| 125 | u32_le unk2; | ||
| 126 | u32_le unk3; | ||
| 127 | u32_le unk4; | ||
| 128 | u32_le unk5; | ||
| 129 | }; | ||
| 130 | static_assert(sizeof(IoctlAllocGpfifoEx) == 32, "IoctlAllocGpfifoEx is incorrect size"); | ||
| 131 | |||
| 85 | struct IoctlAllocGpfifoEx2 { | 132 | struct IoctlAllocGpfifoEx2 { |
| 86 | u32_le num_entries; // in | 133 | u32_le num_entries; // in |
| 87 | u32_le flags; // in | 134 | u32_le flags; // in |