Lines Matching refs:tofd
338 struct mem_to_fd* tofd = 0; in remote_register_fd_attr() local
341 VERIFYC(NULL != (tofd = calloc(1, sizeof(*tofd))), AEE_ENOMEMORY); in remote_register_fd_attr()
342 QNode_CtorZ(&tofd->qn); in remote_register_fd_attr()
344 tofd->buf = buf; in remote_register_fd_attr()
345 tofd->size = size; in remote_register_fd_attr()
346 tofd->fd = fd; in remote_register_fd_attr()
347 tofd->nova = 1; in remote_register_fd_attr()
348 tofd->attr = attr; in remote_register_fd_attr()
351 QList_AppendNode(&fdlist.ql, &tofd->qn); in remote_register_fd_attr()
354 tofd = 0; in remote_register_fd_attr()
360 if(tofd) in remote_register_fd_attr()
362 free(tofd); in remote_register_fd_attr()
363 tofd = NULL; in remote_register_fd_attr()
379 struct mem_to_fd* tofd; in remote_register_buf_common() local
385 tofd = STD_RECOVER_REC(struct mem_to_fd, qn, pn); in remote_register_buf_common()
386 if(tofd->buf == buf && tofd->size == size && tofd->fd == fd) { in remote_register_buf_common()
389 tofd->attr = attr; in remote_register_buf_common()
390 tofd->refcount++; in remote_register_buf_common()
396 VERIFYC(NULL != (tofd = calloc(1, sizeof(*tofd))), AEE_ENOMEMORY); in remote_register_buf_common()
397 QNode_CtorZ(&tofd->qn); in remote_register_buf_common()
398 tofd->buf = buf; in remote_register_buf_common()
399 tofd->size = size; in remote_register_buf_common()
400 tofd->fd = fd; in remote_register_buf_common()
402 tofd->attr = attr; in remote_register_buf_common()
403 tofd->refcount++; in remote_register_buf_common()
405 QList_AppendNode(&fdlist.ql, &tofd->qn); in remote_register_buf_common()
412 struct mem_to_fd* tofd = STD_RECOVER_REC(struct mem_to_fd, qn, pn); in remote_register_buf_common() local
413 if(tofd->buf == buf && tofd->size == size) { in remote_register_buf_common()
414 tofd->refcount--; in remote_register_buf_common()
415 if(tofd->refcount <= 0) { in remote_register_buf_common()
416 QNode_DequeueZ(&tofd->qn); in remote_register_buf_common()
417 if (tofd->attr & FASTRPC_ATTR_KEEP_MAP) { in remote_register_buf_common()
418 remote_unmap_fd(tofd->buf, tofd->size, tofd->fd, tofd->attr); in remote_register_buf_common()
420 if(tofd->nova) { in remote_register_buf_common()
421 munmap(tofd->buf, tofd->size); in remote_register_buf_common()
423 free(tofd); in remote_register_buf_common()
424 tofd = NULL; in remote_register_buf_common()
541 struct mem_to_fd* tofd = STD_RECOVER_REC(struct mem_to_fd, qn, pn); in fdlist_fd_from_buf() local
542 if(STD_BETWEEN(buf, tofd->buf, (unsigned long)tofd->buf + tofd->size)) { in fdlist_fd_from_buf()
543 …if(STD_BETWEEN((unsigned long)buf + bufLen -1, tofd->buf, (unsigned long)tofd->buf + tofd->size)) { in fdlist_fd_from_buf()
544 fd = tofd->fd; in fdlist_fd_from_buf()
545 *nova = tofd->nova; in fdlist_fd_from_buf()
546 *base = tofd->buf; in fdlist_fd_from_buf()
547 *attr = tofd->attr; in fdlist_fd_from_buf()
550 …d FD(%x), address(%p) and size(%x)\n", AEE_EBADPARM, buf, bufLen, tofd->fd, tofd->buf, tofd->size); in fdlist_fd_from_buf()
738 struct mem_to_fd *tofd = STD_RECOVER_REC(struct mem_to_fd, qn, pn); in fdlist_fd_to_buf() local
739 if (STD_BETWEEN(buf, tofd->buf, (unsigned long)tofd->buf + tofd->size)) in fdlist_fd_to_buf()
741 fd = tofd->fd; in fdlist_fd_to_buf()