Lines Matching refs:len

147 static int	iosram_get_keys(iosram_toc_entry_t *buf, uint32_t *len);
656 iosram_rd(uint32_t key, uint32_t off, uint32_t len, caddr_t dptr)
681 IOSRAMLOG(1, "RD: key: 0x%x off:%x len:%x buf:%p\n",
682 key, off, len, buf);
691 chunk_len = (chunkp != NULL) ? chunkp->toc_data.len : 0;
697 } else if ((off >= chunk_len) || (len > chunk_len) ||
698 ((off + len) > chunk_len)) {
722 IOSRAM_STAT_ADD(bread, len);
735 if (cnt > len) {
736 cnt = len;
739 "RD: align rep_get8(buf:%p sramp:%p cnt:%x) len:%x\n",
740 buf, iosramp, cnt, len);
744 len -= cnt;
747 if ((len >= UINT64SZ) &&
752 int cnt = len/UINT64SZ;
755 "RD: rep_get64(buf:%p sramp:%p cnt:%x) len:%x\n",
756 buf, iosramp, cnt, len);
761 len -= cnt * UINT64SZ;
766 if (len >= UINT32SZ) {
768 "RD: get32(buf:%p sramp:%p) len:%x\n",
769 buf, iosramp, len, NULL);
774 len -= UINT32SZ;
777 if (len != 0) {
778 ddi_rep_get8(handle, buf, iosramp, len,
781 } else if ((len >= UINT32SZ) &&
786 int cnt = len/UINT32SZ;
789 "RD: rep_get32(buf:%p sramp:%p cnt:%x) len:%x\n",
790 buf, iosramp, cnt, len);
795 len -= cnt * UINT32SZ;
800 if (len != 0) {
801 ddi_rep_get8(handle, buf, iosramp, len,
804 } else if (len != 0) {
813 "RD: unaligned get32(buf:%p sramp:%p) len:%x\n",
814 buf, iosramp, len, NULL);
815 for (; len >= UINT32SZ; len -= UINT32SZ, iosramp += UINT32SZ) {
826 if (len != 0) {
827 ddi_rep_get8(handle, buf, iosramp, len,
850 * _iosram_write(key, off, len, dptr, force)
854 _iosram_write(uint32_t key, uint32_t off, uint32_t len, caddr_t dptr, int force)
879 IOSRAMLOG(1, "WR: key: 0x%x off:%x len:%x buf:%p\n",
880 key, off, len, buf);
889 chunk_len = (chunkp != NULL) ? chunkp->toc_data.len : 0;
895 } else if ((off >= chunk_len) || (len > chunk_len) ||
896 ((off+len) > chunk_len)) {
930 IOSRAM_STAT_ADD(bwrite, len);
943 if (cnt > len) {
944 cnt = len;
947 "WR: align rep_put8(buf:%p sramp:%p cnt:%x) len:%x\n",
948 buf, iosramp, cnt, len);
952 len -= cnt;
955 if ((len >= UINT64SZ) &&
960 int cnt = len/UINT64SZ;
963 "WR: rep_put64(buf:%p sramp:%p cnt:%x) len:%x\n",
964 buf, iosramp, cnt, len);
969 len -= cnt * UINT64SZ;
974 if (len >= UINT32SZ) {
976 "WR: put32(buf:%p sramp:%p) len:%x\n", buf, iosramp,
977 len, NULL);
982 len -= UINT32SZ;
985 if (len != 0) {
986 ddi_rep_put8(handle, buf, iosramp, len,
989 } else if ((len >= UINT32SZ) &&
994 int cnt = len/UINT32SZ;
997 "WR: rep_put32(buf:%p sramp:%p cnt:%x) len:%x\n",
998 buf, iosramp, cnt, len);
1003 len -= cnt * UINT32SZ;
1008 if (len != 0) {
1009 ddi_rep_put8(handle, buf, iosramp, len,
1012 } else if (len != 0) {
1022 "WR: unaligned put32(buf:%p sramp:%p) len:%x\n",
1023 buf, iosramp, len, NULL);
1024 for (; len >= UINT32SZ; len -= UINT32SZ, iosramp += UINT32SZ) {
1035 if (len != 0) {
1037 len, DDI_DEV_AUTOINCR);
1059 iosram_force_write(uint32_t key, uint32_t off, uint32_t len, caddr_t dptr)
1061 return (_iosram_write(key, off, len, dptr, 1 /* force */));
1066 iosram_wr(uint32_t key, uint32_t off, uint32_t len, caddr_t dptr)
1068 return (_iosram_write(key, off, len, dptr, 0));
1294 *(uint32_t *)arg = chunkp->toc_data.len;
1758 int len;
1765 DPRINTF(2, ("IOSRAM_RD(k:%x o:%x len:%x bufp:%p\n", req.key,
1766 req.off, req.len, (void *)(uintptr_t)req.bufp));
1768 len = req.len;
1769 bufp = kmem_alloc(len, KM_SLEEP);
1771 req.retval = iosram_rd(req.key, req.off, req.len, bufp);
1773 if (ddi_copyout(bufp, (void *)(uintptr_t)req.bufp, len, mode)) {
1775 (void *)bufp, (void *)(uintptr_t)req.bufp, len,
1784 kmem_free(bufp, len);
1792 int len;
1798 DPRINTF(2, ("IOSRAM_WR(k:%x o:%x len:%x bufp:%p\n",
1799 req.key, req.off, req.len, (void *)(uintptr_t)req.bufp));
1800 len = req.len;
1801 bufp = kmem_alloc(len, KM_SLEEP);
1802 if (ddi_copyin((void *)(uintptr_t)req.bufp, bufp, len, mode)) {
1805 req.retval = iosram_wr(req.key, req.off, req.len,
1813 kmem_free(bufp, len);
1820 int len;
1827 DPRINTF(2, ("IOSRAM_TOC (req.bufp:%x req.len:%x) \n",
1828 req.bufp, req.len));
1830 len = req.len;
1831 bufp = kmem_alloc(len, KM_SLEEP);
1834 &req.len);
1836 if (ddi_copyout(bufp, (void *)(uintptr_t)req.bufp, req.len,
1840 (void *)bufp, (void *)(uintptr_t)req.bufp, req.len,
1848 kmem_free(bufp, len);
2574 cmn_err(CE_WARN, "iosram(%d): failed to map IOSRAM len:%x\n",
2796 new_nchunks = index.len - 1;
2805 (chunkp->toc_data.len <= softp->iosramlen) &&
2806 ((chunkp->toc_data.off + chunkp->toc_data.len) <=
2812 chunkp->toc_data.off, chunkp->toc_data.len,
2816 "out of range... off:%x len:%x\n",
2818 chunkp->toc_data.len);
3294 * iosram_get_keys(buf, len)
3298 iosram_get_keys(iosram_toc_entry_t *bufp, uint32_t *len)
3303 int cnt = (*len) / sizeof (iosram_toc_entry_t);
3305 IOSRAMLOG(2, "iosram_get_keys(bufp:%p *len:%x)\n", bufp, *len, NULL,
3321 bufp[i].len = chunkp->toc_data.len;
3324 *len = i * sizeof (iosram_toc_entry_t);