Line 1,002:
Line 1,002:
| 0x40284109 || In || 40 || [[#NVGPU_AS_IOCTL_ALLOC_AS_EX]]
| 0x40284109 || In || 40 || [[#NVGPU_AS_IOCTL_ALLOC_AS_EX]]
|-
|-
−
| 0xC038410A || Inout || 56 || [[#NVGPU_AS_IOCTL_MODIFY]]
+
| 0xC038410A || Inout || 56 || [[#NVGPU_AS_IOCTL_MAP_BUFFER_EX2]]
|-
|-
| 0xC0??4114 || Inout || Variable || [[#NVGPU_AS_IOCTL_REMAP]]
| 0xC0??4114 || Inout || Variable || [[#NVGPU_AS_IOCTL_REMAP]]
Line 1,038:
Line 1,038:
=== NVGPU_AS_IOCTL_MAP_BUFFER ===
=== NVGPU_AS_IOCTL_MAP_BUFFER ===
−
Maps a memory region in the device address space. Identical to Linux driver pretty much.
+
Maps a memory region in the device address space.
+
+
Unaligned size will cause a [[#Panic]].
On success, the mapped memory region is granted the [[SVC#MemoryAttribute|DeviceShared]] attribute.
On success, the mapped memory region is granted the [[SVC#MemoryAttribute|DeviceShared]] attribute.
Line 1,063:
Line 1,065:
__in u32 flags; // bit0: fixed_offset, bit2: cacheable
__in u32 flags; // bit0: fixed_offset, bit2: cacheable
__inout u32 kind; // -1 is default
__inout u32 kind; // -1 is default
−
__in u32 dmabuf_fd; // nvmap handle
+
__in u32 mem_id; // nvmap handle
−
__inout u32 page_size; // 0 means don't care
+
u32 reserved;
__in u64 buffer_offset;
__in u64 buffer_offset;
__in u64 mapping_size;
__in u64 mapping_size;
union {
union {
−
__out u64 offset;
+
__out u64 offset;
−
__in u64 align;
+
__in u64 align;
−
};
+
};
};
};
Line 1,119:
Line 1,121:
};
};
−
=== NVGPU_AS_IOCTL_MODIFY ===
+
=== NVGPU_AS_IOCTL_MAP_BUFFER_EX2 ===
−
Modifies a memory region in the device address space.
+
Maps a memory region in the device address space with extra params.
+
+
Unaligned size will cause a [[#Panic]].
+
+
On success, the mapped memory region is granted the [[SVC#MemoryAttribute|DeviceShared]] attribute.
−
struct {
+
struct {
__in u32 flags; // bit0: fixed_offset, bit2: cacheable
__in u32 flags; // bit0: fixed_offset, bit2: cacheable
−
__in u32 kind; // -1 is default
+
__inout u32 kind; // -1 is default
−
__in u32 dmabuf_fd; // nvmap handle
+
__in u32 mem_id; // nvmap handle
−
__inout u32 page_size; // 0 means don't care
+
u32 reserved0;
__in u64 buffer_offset;
__in u64 buffer_offset;
__in u64 mapping_size;
__in u64 mapping_size;
−
__inout u64 offset;
+
union {
−
__in u64 unk0;
+
__out u64 offset;
−
__in u32 unk1;
+
__in u64 align;
−
u32 reserved;
+
};
+
__in u64 vma_addr;
+
__in u32 pages;
+
u32 reserved1;
};
};
Line 1,139:
Line 1,148:
struct remap_op {
struct remap_op {
−
__in u16 flags; // bit2: cacheable
+
__in u16 flags; // bit2: cacheable
__in u16 kind;
__in u16 kind;
__in u32 mem_handle;
__in u32 mem_handle;
−
__in u32 mem_offset_in_big_pages;
+
__in u32 mem_offset_in_pages;
−
__in u32 virt_offset_in_big_pages; // (alloc_space_offset >> 0x10)
+
__in u32 virt_offset_in_pages; // (alloc_space_offset >> 0x10)
−
__in u32 num_pages; // alloc_space_pages
+
__in u32 num_pages; // alloc_space_pages
};
};