if (!vc_cons_allocated(currcons))
return -ENXIO;
- size = video_num_lines * video_num_columns;
+ size = vc_cons[currcons].d->vc_rows * vc_cons[currcons].d->vc_cols;
if (minor & 128)
size = 2*size + HEADER_SIZE;
{
struct inode *inode = file->f_dentry->d_inode;
unsigned int currcons = iminor(inode);
+ struct vc_data *vc;
long pos;
long viewed, attr, read;
int col, maxcol;
ret = -ENXIO;
if (!vc_cons_allocated(currcons))
goto unlock_out;
+ vc = vc_cons[currcons].d;
ret = -EINVAL;
if (pos < 0)
con_buf_start = con_buf0 = con_buf;
orig_count = this_round;
- maxcol = video_num_columns;
+ maxcol = vc->vc_cols;
if (!attr) {
- org = screen_pos(currcons, p, viewed);
+ org = screen_pos(vc, p, viewed);
col = p % maxcol;
p += maxcol - col;
while (this_round-- > 0) {
- *con_buf0++ = (vcs_scr_readw(currcons, org++) & 0xff);
+ *con_buf0++ = (vcs_scr_readw(vc, org++) & 0xff);
if (++col == maxcol) {
- org = screen_pos(currcons, p, viewed);
+ org = screen_pos(vc, p, viewed);
col = 0;
p += maxcol;
}
if (p < HEADER_SIZE) {
size_t tmp_count;
- con_buf0[0] = (char) video_num_lines;
- con_buf0[1] = (char) video_num_columns;
- getconsxy(currcons, con_buf0 + 2);
+ con_buf0[0] = (char)vc->vc_rows;
+ con_buf0[1] = (char)vc->vc_cols;
+ getconsxy(vc, con_buf0 + 2);
con_buf_start += p;
this_round += p;
p /= 2;
col = p % maxcol;
- org = screen_pos(currcons, p, viewed);
+ org = screen_pos(vc, p, viewed);
p += maxcol - col;
/* Buffer has even length, so we can always copy
this_round = (this_round + 1) >> 1;
while (this_round) {
- *tmp_buf++ = vcs_scr_readw(currcons, org++);
+ *tmp_buf++ = vcs_scr_readw(vc, org++);
this_round --;
if (++col == maxcol) {
- org = screen_pos(currcons, p, viewed);
+ org = screen_pos(vc, p, viewed);
col = 0;
p += maxcol;
}
{
struct inode *inode = file->f_dentry->d_inode;
unsigned int currcons = iminor(inode);
+ struct vc_data *vc;
long pos;
long viewed, attr, size, written;
char *con_buf0;
ret = -ENXIO;
if (!vc_cons_allocated(currcons))
goto unlock_out;
+ vc = vc_cons[currcons].d;
size = vcs_size(inode);
ret = -EINVAL;
con_buf0 = con_buf;
orig_count = this_round;
- maxcol = video_num_columns;
+ maxcol = vc->vc_cols;
p = pos;
if (!attr) {
- org0 = org = screen_pos(currcons, p, viewed);
+ org0 = org = screen_pos(vc, p, viewed);
col = p % maxcol;
p += maxcol - col;
unsigned char c = *con_buf0++;
this_round--;
- vcs_scr_writew(currcons,
- (vcs_scr_readw(currcons, org) & 0xff00) | c, org);
+ vcs_scr_writew(vc,
+ (vcs_scr_readw(vc, org) & 0xff00) | c, org);
org++;
if (++col == maxcol) {
- org = screen_pos(currcons, p, viewed);
+ org = screen_pos(vc, p, viewed);
col = 0;
p += maxcol;
}
if (p < HEADER_SIZE) {
char header[HEADER_SIZE];
- getconsxy(currcons, header + 2);
+ getconsxy(vc, header + 2);
while (p < HEADER_SIZE && this_round > 0) {
this_round--;
header[p++] = *con_buf0++;
}
if (!viewed)
- putconsxy(currcons, header + 2);
+ putconsxy(vc, header + 2);
}
p -= HEADER_SIZE;
col = (p/2) % maxcol;
if (this_round > 0) {
- org0 = org = screen_pos(currcons, p/2, viewed);
+ org0 = org = screen_pos(vc, p/2, viewed);
if ((p & 1) && this_round > 0) {
char c;
this_round--;
c = *con_buf0++;
#ifdef __BIG_ENDIAN
- vcs_scr_writew(currcons, c |
- (vcs_scr_readw(currcons, org) & 0xff00), org);
+ vcs_scr_writew(vc, c |
+ (vcs_scr_readw(vc, org) & 0xff00), org);
#else
- vcs_scr_writew(currcons, (c << 8) |
- (vcs_scr_readw(currcons, org) & 0xff), org);
+ vcs_scr_writew(vc, (c << 8) |
+ (vcs_scr_readw(vc, org) & 0xff), org);
#endif
org++;
p++;
if (++col == maxcol) {
- org = screen_pos(currcons, p/2, viewed);
+ org = screen_pos(vc, p/2, viewed);
col = 0;
}
}
unsigned short w;
w = get_unaligned(((const unsigned short *)con_buf0));
- vcs_scr_writew(currcons, w, org++);
+ vcs_scr_writew(vc, w, org++);
con_buf0 += 2;
this_round -= 2;
if (++col == maxcol) {
- org = screen_pos(currcons, p, viewed);
+ org = screen_pos(vc, p, viewed);
col = 0;
p += maxcol;
}
c = *con_buf0++;
#ifdef __BIG_ENDIAN
- vcs_scr_writew(currcons, (vcs_scr_readw(currcons, org) & 0xff) | (c << 8), org);
+ vcs_scr_writew(vc, (vcs_scr_readw(vc, org) & 0xff) | (c << 8), org);
#else
- vcs_scr_writew(currcons, (vcs_scr_readw(currcons, org) & 0xff00) | c, org);
+ vcs_scr_writew(vc, (vcs_scr_readw(vc, org) & 0xff00) | c, org);
#endif
}
}