static ssize_t kgsl_istore_read( struct file *file, char __user *buff, size_t buff_count, loff_t *ppos) { int i, count, remaining, pos = 0, tot = 0; struct kgsl_device *device = file->private_data; const int rowc = 8; struct adreno_device *adreno_dev; if (!ppos || !device) return 0; adreno_dev = ADRENO_DEVICE(device); count = adreno_dev->istore_size * adreno_dev->instruction_size; remaining = count; for (i = 0; i < count; i += rowc) { unsigned int vals[rowc]; int j, ss; int linec = min(remaining, rowc); remaining -= rowc; if (pos >= *ppos) { for (j = 0; j < linec; ++j) kgsl_regread_nolock(device, ADRENO_ISTORE_START + i + j, vals + j); } else memset(vals, 0, sizeof(vals)); ss = kgsl_hex_dump("IS: %04x: ", i, (uint8_t *)vals, rowc*4, linec*4, buff); if (ss < 0) return ss; if (pos >= *ppos) { if (tot+ss >= buff_count) return tot; tot += ss; buff += ss; *ppos += ss; } pos += ss; } return tot; }
static ssize_t kgsl_istore_read( struct file *file, char __user *buff, size_t buff_count, loff_t *ppos) { int i, count = KGSL_ISTORE_LENGTH, remaining, pos = 0, tot = 0; struct kgsl_device *device = kgsl_get_yamato_generic_device(); const int rowc = 8; if (!ppos || !device) return 0; remaining = count; for (i = 0; i < count; i += rowc) { unsigned int vals[rowc]; int j, ss; int linec = min(remaining, rowc); remaining -= rowc; if (pos >= *ppos) { for (j = 0; j < linec; ++j) kgsl_regread_nolock(device, KGSL_ISTORE_START+i+j, vals+j); } else memset(vals, 0, sizeof(vals)); ss = kgsl_hex_dump("IS: %04x: ", i, (uint8_t *)vals, rowc*4, linec*4, buff); if (ss < 0) return ss; if (pos >= *ppos) { if (tot+ss >= buff_count) return tot; tot += ss; buff += ss; *ppos += ss; } pos += ss; } return tot; }