The vt console interface changed between 2.6.10 and 2.6.11 See: http://linux.bkbits.net:8080/linux-2.6/cset@1.1966.42.57 This allows speakup to compile again. The actual functionality is untested. --- linux-dsd/drivers/char/speakup/speakup.c.orig 2005-03-02 17:34:29.000000000 +0000 +++ linux-dsd/drivers/char/speakup/speakup.c 2005-03-02 18:02:32.000000000 +0000 @@ -366,7 +366,7 @@ speakup_parked (int currcons ) #undef isspace #define isspace(c) ((c) == ' ') /* Variables for selection control. */ -int spk_sel_cons; /* defined in selection.c must not be disallocated */ +struct vc_data *spk_sel_cons; /* defined in selection.c must not be disallocated */ static volatile int sel_start = -1; /* cleared by clear_selection */ static int sel_end; static int sel_buffer_lth; @@ -375,7 +375,7 @@ static char *sel_buffer; static unsigned char sel_pos(int n) { - return inverse_translate(vc_cons[spk_sel_cons].d, screen_glyph(spk_sel_cons, n)); + return inverse_translate(spk_sel_cons, screen_glyph(spk_sel_cons, n)); } static void @@ -405,13 +405,14 @@ speakup_set_selection( struct tty_struct char *bp, *obp; int i, ps, pe; unsigned int currcons = fg_console; + struct vc_data *vc = vc_cons[currcons].d; - xs = limit(xs, video_num_columns - 1); - ys = limit(ys, video_num_lines - 1); - xe = limit(xe, video_num_columns - 1); - ye = limit(ye, video_num_lines - 1); - ps = ys * video_size_row + (xs << 1); - pe = ye * video_size_row + (xe << 1); + xs = limit(xs, vc->vc_cols - 1); + ys = limit(ys, vc->vc_rows - 1); + xe = limit(xe, vc->vc_cols - 1); + ye = limit(ye, vc->vc_rows - 1); + ps = ys * vc->vc_size_row + (xs << 1); + pe = ye * vc->vc_size_row + (xe << 1); if (ps > pe) { /* make sel_start <= sel_end */ int tmp = ps; @@ -419,9 +420,9 @@ speakup_set_selection( struct tty_struct pe = tmp; } - if (spk_sel_cons != fg_console) { + if (spk_sel_cons != vc_cons[fg_console].d) { speakup_clear_selection(); - spk_sel_cons = fg_console; + spk_sel_cons = vc_cons[fg_console].d; printk(KERN_WARNING "Selection: mark console not the same as cut\n"); return -EINVAL; } @@ -431,11 +432,11 @@ speakup_set_selection( struct tty_struct /* select to end of line if on trailing space */ if (new_sel_end > new_sel_start && - !atedge(new_sel_end, video_size_row) && + !atedge(new_sel_end, vc->vc_size_row) && isspace(sel_pos(new_sel_end))) { for (pe = new_sel_end + 2; ; pe += 2) if (!isspace(sel_pos(pe)) || - atedge(pe, video_size_row)) + atedge(pe, vc->vc_size_row)) break; if (isspace(sel_pos(pe))) new_sel_end = pe; @@ -462,7 +463,7 @@ speakup_set_selection( struct tty_struct *bp = sel_pos(i); if (!isspace(*bp++)) obp = bp; - if (! ((i + 2) % video_size_row)) { + if (! ((i + 2) % vc->vc_size_row)) { /* strip trailing blanks from line and add newline, unless non-space at end of line. */ if (obp != bp) { @@ -509,7 +510,7 @@ speakup_cut (int currcons ) mark_cut_flag = 1; xs = spk_x; ys = spk_y; - spk_sel_cons = currcons; + spk_sel_cons = vc_cons[currcons].d; synth_write_msg ("mark" ); return; } @@ -646,7 +647,7 @@ static void say_next_char (int currcons ) { spk_parked |= 0x01; - if (spk_x == video_num_columns - 1 ) { + if (spk_x == vc_cons[currcons].d->vc_cols - 1 ) { announce_edge(currcons, edge_right ); return; } @@ -677,7 +678,7 @@ get_word (int currcons ) *buf = '\0'; synth_write_msg( "space" ); return 0; - } else if ((tmpx < video_num_columns-2 ) + } else if ((tmpx < vc_cons[currcons].d->vc_cols-2 ) && (ch == SPACE || IS_WDLM(ch )) && ((char) scr_readw ((u_short * ) tmp_pos+1 ) > SPACE)) { tmp_pos += 2; @@ -694,7 +695,7 @@ get_word (int currcons ) attr_ch = scr_readw ((u_short * ) tmp_pos ); spk_attr = attr_ch >> 8; buf[cnt++] = attr_ch&0xff; - while (tmpx < video_num_columns-1 ) { + while (tmpx < vc_cons[currcons].d->vc_cols-1 ) { tmp_pos += 2; tmpx++; ch = (char ) scr_readw ((u_short * ) tmp_pos ); @@ -731,7 +732,7 @@ say_prev_word (int currcons ) return; } spk_y--; - spk_x = video_num_columns; + spk_x = vc_cons[currcons].d->vc_cols; edge_said = edge_quiet; } while ( 1 ) { @@ -743,7 +744,7 @@ say_prev_word (int currcons ) if ( edge_said != edge_quiet ) edge_said = edge_left; if ( state > 0 ) break; spk_y--; - spk_x = video_num_columns-1; + spk_x = vc_cons[currcons].d->vc_cols-1; } else spk_x--; spk_pos -= 2; ch = (char ) scr_readw ((u_short * ) spk_pos ); @@ -770,7 +771,7 @@ say_next_word (int currcons ) char ch; u_short edge_said = 0, last_state = 2, state = 0; spk_parked |= 0x01; - if ( spk_x == video_num_columns - 1 && spk_y == video_num_lines-1 ) { + if ( spk_x == vc_cons[currcons].d->vc_cols - 1 && spk_y == vc_cons[currcons].d->vc_rows-1 ) { announce_edge(currcons, edge_bottom ); return; } @@ -780,8 +781,8 @@ say_next_word (int currcons ) else if (IS_WDLM(ch ) ) state = 1; else state = 2; if ( state > last_state ) break; - if (spk_x >= video_num_columns-1 ) { - if (spk_y == video_num_lines-1 ) { + if (spk_x >= vc_cons[currcons].d->vc_cols-1 ) { + if (spk_y == vc_cons[currcons].d->vc_rows-1 ) { edge_said = edge_bottom; break; } @@ -842,7 +843,7 @@ get_line (int currcons ) int i = 0; spk_old_attr = spk_attr; spk_attr = (u_char ) (scr_readw ((u_short * ) spk_pos ) >> 8 ); - for (i = 0; i < video_num_columns; i++ ) { + for (i = 0; i < vc_cons[currcons].d->vc_cols; i++ ) { buf[i] = (u_char ) scr_readw ((u_short * ) tmp ); tmp += 2; } @@ -882,7 +883,7 @@ say_prev_line (int currcons ) return; } spk_y--; - spk_pos -= video_size_row; + spk_pos -= vc_cons[currcons].d->vc_size_row; say_line (currcons ); } @@ -890,12 +891,12 @@ static void say_next_line (int currcons ) { spk_parked |= 0x01; - if (spk_y == video_num_lines - 1 ) { + if (spk_y == vc_cons[currcons].d->vc_rows - 1 ) { announce_edge (currcons, edge_bottom ); return; } spk_y++; - spk_pos += video_size_row; + spk_pos += vc_cons[currcons].d->vc_size_row; say_line (currcons ); } @@ -909,7 +910,7 @@ say_from_to (int currcons, u_long from, while (from < to ) { buf[i++] = (char ) scr_readw ((u_short * ) from ); from += 2; - if ( i >= video_size_row ) break; + if ( i >= vc_cons[currcons].d->vc_size_row ) break; } for (--i; i >= 0; i-- ) if (buf[i] != SPACE ) break; @@ -925,7 +926,7 @@ say_from_to (int currcons, u_long from, static void say_line_from_to (int currcons, u_long from, u_long to, int read_punc ) { - u_long start = origin+(spk_y*video_size_row ); + u_long start = origin+(spk_y*vc_cons[currcons].d->vc_size_row ); u_long end = start+( to * 2 ); start += from*2; if ( say_from_to( currcons, start, end, read_punc ) <= 0 ) @@ -935,12 +936,13 @@ say_line_from_to (int currcons, u_long f static void say_screen_from_to (int currcons, u_long from, u_long to ) { + struct vc_data *vc = vc_cons[currcons].d; u_long start = origin, end; - if ( from > 0 ) start += from * video_size_row; - if ( to > video_num_lines ) to = video_num_lines; - end = origin + ( to * video_size_row); + if ( from > 0 ) start += from * vc->vc_size_row; + if ( to > vc->vc_rows ) to = vc_cons[currcons].d->vc_rows; + end = origin + ( to * vc->vc_size_row); for ( from = start; from < end; from = to ) { - to = from + video_size_row; + to = from + vc->vc_size_row; say_from_to( currcons, from, to, 1 ); } } @@ -948,24 +950,25 @@ say_screen_from_to (int currcons, u_long static void say_screen (int currcons ) { - say_screen_from_to( currcons, 0, video_num_lines ); + say_screen_from_to( currcons, 0, vc_cons[currcons].d->vc_rows ); } static void speakup_win_say (int currcons ) { + struct vc_data *vc = vc_cons[currcons].d; u_long start, end, from, to; if ( win_start < 2 ) { synth_write_msg( "no window" ); return; } - start = origin + ( win_top * video_size_row ); - end = origin + ( win_bottom * video_size_row ); + start = origin + ( win_top * vc->vc_size_row ); + end = origin + ( win_bottom * vc->vc_size_row ); while ( start <= end ) { from = start + ( win_left * 2 ); to = start + ( win_right * 2 ); say_from_to( currcons, from, to, 1 ); - start += video_size_row; + start += vc->vc_size_row; } } @@ -981,9 +984,10 @@ top_edge (int currcons ) static void bottom_edge (int currcons ) { + struct vc_data *vc = vc_cons[currcons].d; spk_parked |= 0x01; - spk_pos += (video_num_lines - spk_y - 1 ) * video_size_row; - spk_y = video_num_lines - 1; + spk_pos += (vc->vc_rows - spk_y - 1 ) * vc->vc_size_row; + spk_y = vc->vc_rows - 1; say_line (currcons ); } @@ -1000,8 +1004,8 @@ static void right_edge (int currcons ) { spk_parked |= 0x01; - spk_pos += (video_num_columns - spk_x - 1 ) * 2; - spk_x = video_num_columns - 1; + spk_pos += (vc_cons[currcons].d->vc_cols - spk_x - 1 ) * 2; + spk_x = vc_cons[currcons].d->vc_cols - 1; say_char (currcons ); } @@ -1071,7 +1075,7 @@ say_from_top (int currcons ) static void say_to_bottom (int currcons ) { - say_screen_from_to (currcons, spk_y, video_num_lines ); + say_screen_from_to (currcons, spk_y, vc_cons[currcons].d->vc_rows ); } static void @@ -1083,7 +1087,7 @@ say_from_left (int currcons ) static void say_to_right (int currcons ) { - say_line_from_to (currcons, spk_x, video_num_columns, 1 ); + say_line_from_to (currcons, spk_x, vc_cons[currcons].d->vc_cols, 1 ); } /* end of stub functions. */ @@ -1303,7 +1307,7 @@ void __init speakup_open (int currcons, init_sleeper ( synth_sleeping_list ); strlwr (synth_name ); synth_init ( synth_name ); - spk_num_vars[0].high = video_num_columns; + spk_num_vars[0].high = vc_cons[currcons].d->vc_cols; for ( n_var = spk_num_vars; n_var->var_id >= 0; n_var++ ) speakup_register_var( n_var ); for (i = 1; punc_info[i].mask != 0; i++ ) @@ -1837,7 +1841,7 @@ cursor_done (u_long data ) } } if ( is_cursor == 1 || is_cursor == 4 ) - say_line_from_to (currcons, 0, video_num_columns, 0 ); + say_line_from_to (currcons, 0, vc_cons[currcons].d->vc_cols, 0 ); else say_char ( currcons ); spk_keydown = is_cursor = 0; } @@ -1951,7 +1955,7 @@ speakup_win_set (int currcons ) } if ( win_start && spk_x == win_left && spk_y == win_top ) { win_left = 0; - win_right = video_num_columns-1; + win_right = vc_cons[currcons].d->vc_cols-1; win_bottom = spk_y; sprintf( info, "window is line %d", (int)win_top+1 ); } else { @@ -2011,6 +2015,7 @@ static int handle_goto (int currcons, u_ static int num = 0; short maxlen, go_pos; char *cp; + struct vc_data *vc = vc_cons[currcons].d; if ( type == KT_SPKUP && ch == SPEAKUP_GOTO ) goto do_goto; if ( type == KT_LATIN && ch == '\n' ) goto do_goto; if ( type != 0 ) goto oops; @@ -2043,14 +2048,14 @@ oops: if (*goto_buf < '0' ) goto_pos += spk_x; else goto_pos--; if (goto_pos < 0 ) goto_pos = 0; - if (goto_pos >= video_num_columns ) - goto_pos = video_num_columns-1; + if (goto_pos >= vc->vc_cols ) + goto_pos = vc->vc_cols-1; goto_x = 1; } else { if (*goto_buf < '0' ) goto_pos += spk_y; else goto_pos--; if (goto_pos < 0 ) goto_pos = 0; - if (goto_pos >= video_num_lines ) goto_pos = video_num_lines-1; + if (goto_pos >= vc->vc_rows ) goto_pos = vc->vc_rows-1; goto_x = 0; } goto_buf[num = 0] = '\0'; @@ -2064,7 +2069,7 @@ do_goto: say_word( currcons ); } else { spk_y = goto_pos; - spk_pos = origin + ( goto_pos * video_size_row ); + spk_pos = origin + ( goto_pos * vc->vc_size_row ); say_line( currcons ); } return 1;