libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
nv_ioc.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #define NVHOST_IOC_CTRL_SYNCPT_READ 0xC0080014
13 #define NVHOST_IOC_CTRL_SYNCPT_INCR 0x40040015
14 #define NVHOST_IOC_CTRL_SYNCPT_WAIT 0xC00C0016
15 #define NVHOST_IOC_CTRL_MODULE_MUTEX 0x40080017
16 #define NVHOST_IOC_CTRL_MODULE_REGRDWR 0xC0180018
17 #define NVHOST_IOC_CTRL_SYNCPT_WAITEX 0xC0100019
18 #define NVHOST_IOC_CTRL_SYNCPT_READ_MAX 0xC008001A
19 #define NVHOST_IOC_CTRL_GET_CONFIG 0xC183001B
20 #define NVHOST_IOC_CTRL_EVENT_SIGNAL 0xC004001C
21 #define NVHOST_IOC_CTRL_EVENT_WAIT 0xC010001D
22 #define NVHOST_IOC_CTRL_EVENT_WAIT_ASYNC 0xC010001E
23 #define NVHOST_IOC_CTRL_EVENT_REGISTER 0xC004001F
24 #define NVHOST_IOC_CTRL_EVENT_UNREGISTER 0xC0040020
25 #define NVHOST_IOC_CTRL_EVENT_KILL 0x40080021
26 
27 #define NVMAP_IOC_CREATE 0xC0080101
28 #define NVMAP_IOC_FROM_ID 0xC0080103
29 #define NVMAP_IOC_ALLOC 0xC0200104
30 #define NVMAP_IOC_FREE 0xC0180105
31 #define NVMAP_IOC_PARAM 0xC00C0109
32 #define NVMAP_IOC_GET_ID 0xC008010E
33 
38 typedef struct {
39  uint32_t syncpt_id;
40  uint32_t threshold;
41  int32_t timeout;
43 
48 typedef struct {
49  uint32_t syncpt_id;
50  uint32_t threshold;
51  int32_t timeout;
52  uint32_t value;
54 
61 typedef struct {
62  uint32_t size;
63  uint32_t handle;
65 
72 typedef struct {
73  uint32_t id;
74  uint32_t handle;
76 
83 typedef struct {
84  uint32_t handle;
85  uint32_t heapmask;
86  uint32_t flags;
87  uint32_t align;
88  uint8_t kind;
89  uint8_t pad[7];
90  uint64_t addr;
92 
97 typedef struct {
98  uint32_t handle;
99  uint32_t pad;
100  uint64_t refcount;
101  uint32_t size;
102  uint32_t flags;
104 
111 typedef struct {
112  uint32_t handle;
113  uint32_t param;
114  uint32_t value;
116 
123 typedef struct {
124  uint32_t id;
125  uint32_t handle;
127 
128 #ifdef __cplusplus
129 }
130 #endif
uint32_t handle
In.
Definition: nv_ioc.h:125
uint32_t flags
out (1=NOT_FREED_YET)
Definition: nv_ioc.h:102
uint32_t syncpt_id
In.
Definition: nv_ioc.h:49
Definition: nv_ioc.h:38
uint32_t handle
Out.
Definition: nv_ioc.h:74
ID query args structure for an nvmap object.
Definition: nv_ioc.h:123
uint32_t id
Out ~0 indicates error.
Definition: nv_ioc.h:124
Info query args structure for an nvmap object.
Definition: nv_ioc.h:111
Memory allocation args structure for the nvmap object.
Definition: nv_ioc.h:83
uint32_t size
In.
Definition: nv_ioc.h:62
uint32_t id
In.
Definition: nv_ioc.h:73
int32_t timeout
In.
Definition: nv_ioc.h:41
uint32_t size
out
Definition: nv_ioc.h:101
uint32_t flags
(0=read-only, 1=read-write)
Definition: nv_ioc.h:86
uint32_t threshold
In.
Definition: nv_ioc.h:40
Args to get the handle to an existing nvmap object.
Definition: nv_ioc.h:72
uint64_t refcount
out
Definition: nv_ioc.h:100
uint32_t threshold
In.
Definition: nv_ioc.h:50
uint32_t param
// 1=SIZE, 2=ALIGNMENT, 3=BASE (returns error), 4=HEAP (always 0x40000000), 5=KIND, 6=COMPR (unused)
Definition: nv_ioc.h:113
Args to create an nvmap object.
Definition: nv_ioc.h:61
uint32_t value
Inout.
Definition: nv_ioc.h:52
Memory freeing args structure for the nvmap object.
Definition: nv_ioc.h:97
uint32_t syncpt_id
In.
Definition: nv_ioc.h:39
int32_t timeout
In.
Definition: nv_ioc.h:51
Definition: nv_ioc.h:48
uint32_t handle
Out.
Definition: nv_ioc.h:63