static void handle_nvrm_ioctl_create_unk34(struct nvrm_ioctl_create_unk34 *s) { if (s->status != NVRM_STATUS_SUCCESS) return; nvrm_add_object(s->cid, s->parent, s->handle, 0xffffffff);//TODO:class }
static void handle_nvrm_ioctl_create_simple(struct nvrm_ioctl_create_simple *s) { if (s->status != NVRM_STATUS_SUCCESS) return; pushbuf_add_object(s->handle, s->cls); nvrm_add_object(s->cid, s->parent, s->handle, s->cls); }
static void handle_nvrm_ioctl_memory(struct nvrm_ioctl_memory *s) { if (s->status != NVRM_STATUS_SUCCESS) return; if (s->handle) nvrm_add_object(s->cid, s->parent, s->handle, s->cls); }
static void handle_nvrm_ioctl_create_dma(uint32_t fd, struct nvrm_ioctl_create_dma *s) { if (s->status != NVRM_STATUS_SUCCESS) return; check_cid(s->cid); nvrm_add_object(fd, s->cid, s->parent, s->handle, s->cls); }
static void check_cid(uint32_t cid) { if (cid_not_found && gpu_object_find(cid, cid) == NULL) { nvrm_add_object(-1, cid, cid, cid, 0x0041); cid_not_found--; } }
static void handle_nvrm_ioctl_create_simple(uint32_t fd, struct nvrm_ioctl_create_simple *s) { if (s->status != NVRM_STATUS_SUCCESS) return; check_cid(s->cid); struct gpu_object *obj = nvrm_add_object(fd, s->cid, s->parent, s->handle, s->cls); pushbuf_add_object(s->handle, s->cls, obj); }
static void handle_nvrm_ioctl_create(uint32_t fd, struct nvrm_ioctl_create *s, struct mmt_memory_dump *args, int argc) { if (s->status != NVRM_STATUS_SUCCESS) return; uint32_t cid = s->cid; uint32_t parent = s->parent; uint32_t handle = s->handle; struct mmt_buf *data = NULL; if (s->ptr) data = find_ptr(s->ptr, args, argc); if (handle == 0) { if (!data || data->len < 4) { mmt_error("\"create cid\" without data - probably because this trace was obtained by old mmt version (before Sep 6 2014)%s\n", ""); cid_not_found++; return; } cid = parent = handle = ((uint32_t *)data->data)[0]; } check_cid(cid); struct gpu_object *obj = nvrm_add_object(fd, cid, parent, handle, s->cls); pushbuf_add_object(handle, s->cls, obj); if (is_fifo_ib_class(s->cls)) { if (data) { struct fifo_state *state = get_fifo_state(obj); struct nvrm_create_fifo_ib *create_data = (void *)data->data; state->ib.addr = create_data->ib_addr; state->ib.entries = create_data->ib_entries; } } else if (is_fifo_dma_class(s->cls)) { if (data) { struct fifo_state *state = get_fifo_state(obj); struct nvrm_create_fifo_dma *create_data = (void *)data->data; state->user.addr = create_data->user_addr; } } }
static void handle_nvrm_ioctl_create_vspace56(uint32_t fd, struct nvrm_ioctl_create_vspace56 *s) { if (s->status != NVRM_STATUS_SUCCESS) return; check_cid(s->cid); struct gpu_object *obj = nvrm_add_object(fd, s->cid, s->parent, s->handle, s->cls); if (!obj) { mmt_error("nvrm_ioctl_create_vspace56: cannot find object 0x%08x 0x%08x\n", s->cid, s->handle); return; } if (s->map_id) host_map(obj, fd, 0, 0, s->limit + 1, 0, s->map_id); }
static void handle_nvrm_ioctl_create(struct nvrm_ioctl_create *s, struct mmt_memory_dump *args, int argc) { if (s->status != NVRM_STATUS_SUCCESS) return; uint32_t cid = s->cid; uint32_t parent = s->parent; uint32_t handle = s->handle; if (handle == 0) { struct mmt_buf *data = find_ptr(s->ptr, args, argc); if (!data || data->len < 4) { mmt_error("\"create cid\" without data - probably because of old mmt (before Sep 6 2014) was used%s\n", ""); return; } cid = parent = handle = ((uint32_t *)data->data)[0]; } pushbuf_add_object(handle, s->cls); nvrm_add_object(cid, parent, handle, s->cls); }
static void handle_nvrm_ioctl_create_vspace(struct nvrm_ioctl_create_vspace *s) { if (s->foffset != 0) { struct buffer *buf; int found = 0; for (buf = buffers_list; buf != NULL; buf = buf->next) if (buf->mmap_offset == s->foffset) { buf->data1 = s->parent; buf->data2 = s->handle; found = 1; break; } if (!found) { for (buf = gpu_only_buffers_list; buf != NULL; buf = buf->next) { if (buf->data1 == s->parent && buf->data2 == s->handle) { mmt_log("TODO: gpu only buffer found (0x%016lx), NVRM_IOCTL_CREATE_VSPACE handling needs to be updated!\n", buf->gpu_start); break; } } struct unk_map *m = malloc(sizeof(struct unk_map)); m->data1 = s->parent; m->data2 = s->handle; m->mmap_offset = s->foffset; m->next = unk_maps; unk_maps = m; } } nvrm_add_object(s->cid, s->parent, s->handle, s->cls); }
static void handle_nvrm_ioctl_create_dma(struct nvrm_ioctl_create_dma *s) { nvrm_add_object(s->cid, s->parent, s->handle, s->cls); }