libnx  v4.7.0
map.h
1 #pragma once
2 #include "types.h"
3 
4 typedef struct NvMap {
5  u32 handle;
6  u32 id;
7  u32 size;
8  void* cpu_addr;
9  NvKind kind;
10  bool has_init;
11  bool is_cpu_cacheable;
12 } NvMap;
13 
14 Result nvMapInit(void);
15 u32 nvMapGetFd(void);
16 void nvMapExit(void);
17 
18 Result nvMapCreate(NvMap* m, void* cpu_addr, u32 size, u32 align, NvKind kind, bool is_cpu_cacheable);
19 Result nvMapLoadRemote(NvMap* m, u32 id);
20 void nvMapClose(NvMap* m);
21 
22 static inline u32 nvMapGetHandle(NvMap* m)
23 {
24  return m->handle;
25 }
26 
27 static inline u32 nvMapGetId(NvMap* m)
28 {
29  return m->id;
30 }
31 
32 static inline u32 nvMapGetSize(NvMap* m)
33 {
34  return m->size;
35 }
36 
37 static inline void* nvMapGetCpuAddr(NvMap* m)
38 {
39  return m->cpu_addr;
40 }
41 
42 static inline bool nvMapIsRemote(NvMap* m)
43 {
44  return !m->cpu_addr;
45 }
46 
47 static inline NvKind nvMapGetKind(NvMap* m)
48 {
49  return m->kind;
50 }
Definition: map.h:4
Various system types.
u32 Result
Function error code result type.
Definition: types.h:44
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21