Compare commits

...

1 Commits

Author SHA1 Message Date
Feng Chen
d2113c0243 nvhost_ctrl: Stub out IocCtrlEventKill 2021-10-28 15:51:25 +08:00
2 changed files with 23 additions and 2 deletions

View File

@@ -38,6 +38,8 @@ NvResult nvhost_ctrl::Ioctl1(DeviceFD fd, Ioctl command, const std::vector<u8>&
return IocCtrlEventRegister(input, output);
case 0x20:
return IocCtrlEventUnregister(input, output);
case 0x21:
return IocCtrlEventKill(input, output);
}
break;
default:
@@ -221,4 +223,22 @@ NvResult nvhost_ctrl::IocCtrlClearEventWait(const std::vector<u8>& input, std::v
return NvResult::Success;
}
NvResult nvhost_ctrl::IocCtrlEventKill(const std::vector<u8>& input, std::vector<u8>& output) {
IocCtrlEventKillParams params{};
std::memcpy(&params, input.data(), sizeof(params));
LOG_WARNING(Service_NVDRV, "called, user_events={}", params.user_events);
for (u32 event_id = 0; event_id < MaxNvEvents; ++event_id) {
if ((params.user_events & (1ULL << (int)event_id)) != 0) {
if (!events_interface.registered[event_id]) {
continue;
}
events_interface.UnregisterEvent(event_id);
}
}
return NvResult::Success;
}
} // namespace Service::Nvidia::Devices

View File

@@ -119,16 +119,17 @@ private:
static_assert(sizeof(IocCtrlEventUnregisterParams) == 4,
"IocCtrlEventUnregisterParams is incorrect size");
struct IocCtrlEventKill {
struct IocCtrlEventKillParams {
u64_le user_events{};
};
static_assert(sizeof(IocCtrlEventKill) == 8, "IocCtrlEventKill is incorrect size");
static_assert(sizeof(IocCtrlEventKillParams) == 8, "IocCtrlEventKillParams is incorrect size");
NvResult NvOsGetConfigU32(const std::vector<u8>& input, std::vector<u8>& output);
NvResult IocCtrlEventWait(const std::vector<u8>& input, std::vector<u8>& output, bool is_async);
NvResult IocCtrlEventRegister(const std::vector<u8>& input, std::vector<u8>& output);
NvResult IocCtrlEventUnregister(const std::vector<u8>& input, std::vector<u8>& output);
NvResult IocCtrlClearEventWait(const std::vector<u8>& input, std::vector<u8>& output);
NvResult IocCtrlEventKill(const std::vector<u8>& input, std::vector<u8>& output);
EventInterface& events_interface;
SyncpointManager& syncpoint_manager;