mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +02:00
nvQueryEvent: return an Event instead of a raw Handle
This commit is contained in:
parent
7f8b6af64c
commit
99f37184fb
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user