nvQueryEvent: return an Event instead of a raw Handle

This commit is contained in:
fincs 2018-08-30 00:48:17 +02:00
parent 7f8b6af64c
commit 99f37184fb
3 changed files with 6 additions and 9 deletions

View File

@ -6,6 +6,7 @@
*/
#pragma once
#include "../types.h"
#include "../kernel/event.h"
Result nvInitialize(void);
void nvExit(void);
@ -25,6 +26,6 @@ typedef enum {
Result nvOpen(u32 *fd, const char *devicepath);
Result nvIoctl(u32 fd, u32 request, void* argp);
Result nvClose(u32 fd);
Result nvQueryEvent(u32 fd, u32 event_id, Handle *handle_out);
Result nvQueryEvent(u32 fd, u32 event_id, Event *event_out);
Result nvConvertError(int rc);

View File

@ -20,15 +20,11 @@
Result nvErrorNotifierCreate(NvErrorNotifier* t, NvGpu* parent)
{
Result rc;
Handle handle;
rc = nvQueryEvent(
parent->gpu_channel.fd, NvEventId_Gpu_ErrorNotifier, &handle);
rc = nvQueryEvent(parent->gpu_channel.fd, NvEventId_Gpu_ErrorNotifier, &t->event);
if (R_SUCCEEDED(rc)) {
eventLoadRemote(&t->event, handle, true);
if (R_SUCCEEDED(rc))
rc = nvioctlChannel_SetErrorNotifier(parent->gpu_channel.fd, 1);
}
if (R_SUCCEEDED(rc)) {
t->parent = parent;

View File

@ -288,7 +288,7 @@ Result nvClose(u32 fd) {
return rc;
}
Result nvQueryEvent(u32 fd, u32 event_id, Handle *handle_out) {
Result nvQueryEvent(u32 fd, u32 event_id, Event *event_out) {
IpcCommand c;
ipcInitialize(&c);
@ -323,7 +323,7 @@ Result nvQueryEvent(u32 fd, u32 event_id, Handle *handle_out) {
rc = nvConvertError(resp->error);
if (R_SUCCEEDED(rc))
*handle_out = r.Handles[0];
eventLoadRemote(event_out, r.Handles[0], true);
}
return rc;