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
|
#pragma once
|
||||||
#include "../types.h"
|
#include "../types.h"
|
||||||
|
#include "../kernel/event.h"
|
||||||
|
|
||||||
Result nvInitialize(void);
|
Result nvInitialize(void);
|
||||||
void nvExit(void);
|
void nvExit(void);
|
||||||
@ -25,6 +26,6 @@ typedef enum {
|
|||||||
Result nvOpen(u32 *fd, const char *devicepath);
|
Result nvOpen(u32 *fd, const char *devicepath);
|
||||||
Result nvIoctl(u32 fd, u32 request, void* argp);
|
Result nvIoctl(u32 fd, u32 request, void* argp);
|
||||||
Result nvClose(u32 fd);
|
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);
|
Result nvConvertError(int rc);
|
||||||
|
@ -20,15 +20,11 @@
|
|||||||
Result nvErrorNotifierCreate(NvErrorNotifier* t, NvGpu* parent)
|
Result nvErrorNotifierCreate(NvErrorNotifier* t, NvGpu* parent)
|
||||||
{
|
{
|
||||||
Result rc;
|
Result rc;
|
||||||
Handle handle;
|
|
||||||
|
|
||||||
rc = nvQueryEvent(
|
rc = nvQueryEvent(parent->gpu_channel.fd, NvEventId_Gpu_ErrorNotifier, &t->event);
|
||||||
parent->gpu_channel.fd, NvEventId_Gpu_ErrorNotifier, &handle);
|
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc))
|
||||||
eventLoadRemote(&t->event, handle, true);
|
|
||||||
rc = nvioctlChannel_SetErrorNotifier(parent->gpu_channel.fd, 1);
|
rc = nvioctlChannel_SetErrorNotifier(parent->gpu_channel.fd, 1);
|
||||||
}
|
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc)) {
|
if (R_SUCCEEDED(rc)) {
|
||||||
t->parent = parent;
|
t->parent = parent;
|
||||||
|
@ -288,7 +288,7 @@ Result nvClose(u32 fd) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result nvQueryEvent(u32 fd, u32 event_id, Handle *handle_out) {
|
Result nvQueryEvent(u32 fd, u32 event_id, Event *event_out) {
|
||||||
IpcCommand c;
|
IpcCommand c;
|
||||||
ipcInitialize(&c);
|
ipcInitialize(&c);
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ Result nvQueryEvent(u32 fd, u32 event_id, Handle *handle_out) {
|
|||||||
rc = nvConvertError(resp->error);
|
rc = nvConvertError(resp->error);
|
||||||
|
|
||||||
if (R_SUCCEEDED(rc))
|
if (R_SUCCEEDED(rc))
|
||||||
*handle_out = r.Handles[0];
|
eventLoadRemote(event_out, r.Handles[0], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user