libnx  v4.2.0
nv.h
Go to the documentation of this file.
1 /**
2  * @file nv.h
3  * @brief NVIDIA low level driver (nvdrv*) service IPC wrapper.
4  * @author yellows8
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../sf/service.h"
10 #include "../kernel/event.h"
11 
12 /// Initialize nvdrv*.
13 Result nvInitialize(void);
14 
15 /// Exit nvdrv*.
16 void nvExit(void);
17 
18 /// Gets the Service object for the actual nvdrv* service session.
20 
21 typedef enum {
22  NvEventId_Gpu_SmException_BptIntReport=1,
23  NvEventId_Gpu_SmException_BptPauseReport=2,
24  NvEventId_Gpu_ErrorNotifier=3,
25 
26  NvEventId_CtrlGpu_ErrorEventHandle=1,
27  NvEventId_CtrlGpu_Unknown=2,
28 } NvEventId;
29 
30 #define NV_EVENT_ID_CTRL__SYNCPT(slot, syncpt) \
31  ((1u<<28) | ((syncpt) << 16) | (slot))
32 
33 Result nvOpen(u32 *fd, const char *devicepath);
34 Result nvIoctl(u32 fd, u32 request, void* argp);
35 Result nvIoctl2(u32 fd, u32 request, void* argp, const void* inbuf, size_t inbuf_size);
36 Result nvClose(u32 fd);
37 Result nvQueryEvent(u32 fd, u32 event_id, Event *event_out);
38 
39 Result nvConvertError(int rc);
Event
Kernel-mode event structure.
Definition: event.h:13
u32
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21
nvGetServiceSession
Service * nvGetServiceSession(void)
Gets the Service object for the actual nvdrv* service session.
nvExit
void nvExit(void)
Exit nvdrv*.
Result
u32 Result
Function error code result type.
Definition: types.h:44
Service
Service object structure.
Definition: service.h:13
nvInitialize
Result nvInitialize(void)
Initialize nvdrv*.