static void SAK(void) { do_SAK(tty); #if 0 /* * Need to fix SAK handling to fix up RAW/MEDIUM_RAW and * vt_cons modes before we can enable RAW/MEDIUM_RAW SAK * handling. * * We should do this some day --- the whole point of a secure * attention key is that it should be guaranteed to always * work. */ clr_vc_kbd_flag(kbd, VC_RAW); clr_vc_kbd_flag(kbd, VC_MEDIUMRAW); vt_cons[fg_console].vc_mode = KD_TEXT; vt_cons[fg_console].vt_mode.mode = VT_AUTO; vt_cons[fg_console].vt_mode.waitv = 0; vt_cons[fg_console].vt_mode.relsig = 0; vt_cons[fg_console].vt_mode.acqsig = 0; vt_cons[fg_console].vt_mode.frsig = 0; vt_cons[fg_console].vt_pid = -1; vt_cons[fg_console].vt_newvt = -1; unblank_screen(); #endif }
static void sysrq_handle_SAK(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { if (tty) do_SAK(tty); reset_vc(fg_console); }
void gs_got_break(struct gs_port *port) { if (port->flags & ASYNC_SAK) { do_SAK (port->tty); } *(port->tty->flip.flag_buf_ptr) = TTY_BREAK; port->tty->flip.flag_buf_ptr++; port->tty->flip.char_buf_ptr++; port->tty->flip.count++; }
static void sysrq_handle_SAK(int key, struct pt_regs *pt_regs, struct tty_struct *tty) { if (tty) do_SAK(tty); if (tty->driver->type == TTY_DRIVER_TYPE_CONSOLE) { struct vc_data *vc = (struct vc_data *) tty->driver_data; if (vc) reset_vc(vc); } }
void gs_got_break(struct gs_port *port) { func_enter (); tty_insert_flip_char(port->tty, 0, TTY_BREAK); tty_schedule_flip(port->tty); if (port->flags & ASYNC_SAK) { do_SAK (port->tty); } func_exit (); }
static void SAK(void) { do_SAK(tty); #if 0 /* * Need to fix SAK handling to fix up RAW/MEDIUM_RAW and * vt_cons modes before we can enable RAW/MEDIUM_RAW SAK * handling. * * We should do this some day --- the whole point of a secure * attention key is that it should be guaranteed to always * work. */ reset_vc(fg_console); do_unblank_screen(); /* not in interrupt routine? */ #endif }
static _INLINE_ void handle_error(struct sci_struct *sci) { struct tty_struct *tty = sci->info->tty; int status; status=sci_in(sci,SCI_SSR); if (status & SCI_SSR_FER) { if(sci_break_det(sci)) { #ifdef SERIAL_DEBUG_INTR printk("handling break...."); #endif *tty->flip.flag_buf_ptr++ = TTY_BREAK; if (sci->info->flags & ASYNC_SAK) { do_SAK(tty); } } else { *tty->flip.flag_buf_ptr++ = TTY_FRAME; } } else if (status & SCI_SSR_PER) *tty->flip.flag_buf_ptr++ = TTY_PARITY; else if (status & SCI_SSR_ORER) *tty->flip.flag_buf_ptr++ = TTY_OVERRUN; }
static void receive_chars(struct serial_state *info) { int status; int serdatr; struct tty_struct *tty = info->tport.tty; unsigned char ch, flag; struct async_icount *icount; int oe = 0; icount = &info->icount; status = UART_LSR_DR; /* We obviously have a character! */ serdatr = custom.serdatr; mb(); custom.intreq = IF_RBF; mb(); if((serdatr & 0x1ff) == 0) status |= UART_LSR_BI; if(serdatr & SDR_OVRUN) status |= UART_LSR_OE; ch = serdatr & 0xff; icount->rx++; #ifdef SERIAL_DEBUG_INTR printk("DR%02x:%02x...", ch, status); #endif flag = TTY_NORMAL; /* * We don't handle parity or frame errors - but I have left * the code in, since I'm not sure that the errors can't be * detected. */ if (status & (UART_LSR_BI | UART_LSR_PE | UART_LSR_FE | UART_LSR_OE)) { /* * For statistics only */ if (status & UART_LSR_BI) { status &= ~(UART_LSR_FE | UART_LSR_PE); icount->brk++; } else if (status & UART_LSR_PE) icount->parity++; else if (status & UART_LSR_FE) icount->frame++; if (status & UART_LSR_OE) icount->overrun++; /* * Now check to see if character should be * ignored, and mask off conditions which * should be ignored. */ if (status & info->ignore_status_mask) goto out; status &= info->read_status_mask; if (status & (UART_LSR_BI)) { #ifdef SERIAL_DEBUG_INTR printk("handling break...."); #endif flag = TTY_BREAK; if (info->tport.flags & ASYNC_SAK) do_SAK(tty); } else if (status & UART_LSR_PE) flag = TTY_PARITY; else if (status & UART_LSR_FE) flag = TTY_FRAME; if (status & UART_LSR_OE) { /* * Overrun is special, since it's * reported immediately, and doesn't * affect the current character */ oe = 1; } } tty_insert_flip_char(tty, ch, flag); if (oe == 1) tty_insert_flip_char(tty, 0, TTY_OVERRUN); tty_flip_buffer_push(tty); out: return; }
static _INLINE_ void receive_chars(ser_info_t *info) { struct tty_struct *tty = info->port.tty; unsigned char ch, flag, *cp; /*int ignored = 0;*/ int i; ushort status; struct async_icount *icount; /* struct async_icount_24 *icount; */ volatile QUICC_BD *bdp; icount = &info->state->icount; /* Just loop through the closed BDs and copy the characters into * the buffer. */ bdp = info->rx_cur; for (;;) { if (bdp->status & BD_SC_EMPTY) /* If this one is empty */ break; /* we are all done */ /* The read status mask tell us what we should do with * incoming characters, especially if errors occur. * One special case is the use of BD_SC_EMPTY. If * this is not set, we are supposed to be ignoring * inputs. In this case, just mark the buffer empty and * continue. */ if (!(info->read_status_mask & BD_SC_EMPTY)) { bdp->status |= BD_SC_EMPTY; bdp->status &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV); if (bdp->status & BD_SC_WRAP) bdp = info->rx_bd_base; else bdp++; continue; } /* Get the number of characters and the buffer pointer. */ i = bdp->length; /* cp = (unsigned char *)__va(bdp->buf); */ cp = (char *)bdp->buf; status = bdp->status; while (i-- > 0) { ch = *cp++; icount->rx++; #ifdef SERIAL_DEBUG_INTR printk("DR%02x:%02x...", ch, status); #endif flag = TTY_NORMAL; if (status & (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV)) { /* * For statistics only */ if (status & BD_SC_BR) icount->brk++; else if (status & BD_SC_PR) icount->parity++; else if (status & BD_SC_FR) icount->frame++; if (status & BD_SC_OV) icount->overrun++; /* * Now check to see if character should be * ignored, and mask off conditions which * should be ignored. if (status & info->ignore_status_mask) { if (++ignored > 100) break; continue; } */ status &= info->read_status_mask; if (status & (BD_SC_BR)) { #ifdef SERIAL_DEBUG_INTR printk("handling break...."); #endif *tty->flip.flag_buf_ptr = TTY_BREAK; if (info->flags & ASYNC_SAK) do_SAK(tty); } else if (status & BD_SC_PR) flag = TTY_PARITY; else if (status & BD_SC_FR) flag = TTY_FRAME; } tty_insert_flip_char(tty, ch, flag); if (status & BD_SC_OV) /* * Overrun is special, since it's * reported immediately, and doesn't * affect the current character */ tty_insert_flip_char(tty, 0, TTY_OVERRUN); } /* This BD is ready to be used again. Clear status. * Get next BD. */ bdp->status |= BD_SC_EMPTY; bdp->status &= ~(BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV); if (bdp->status & BD_SC_WRAP) bdp = info->rx_bd_base; else bdp++; } info->rx_cur = (QUICC_BD *)bdp; tty_schedule_flip(tty); }
void handle_sysrq(int key, struct pt_regs *pt_regs, struct kbd_struct *kbd, struct tty_struct *tty) { int orig_log_level = console_loglevel; if (!key) return; console_loglevel = 7; printk(KERN_INFO "SysRq: "); switch (key) { case 'r': /* R -- Reset raw mode */ if (kbd) { kbd->kbdmode = VC_XLATE; printk("Keyboard mode set to XLATE\n"); } break; #ifdef CONFIG_VT case 'k': /* K -- SAK */ printk("SAK\n"); if (tty) do_SAK(tty); reset_vc(fg_console); break; #endif case 'b': /* B -- boot immediately */ printk("Resetting\n"); machine_restart(NULL); break; case 'o': /* O -- power off */ if (sysrq_power_off) { printk("Power off\n"); sysrq_power_off(); } break; case 's': /* S -- emergency sync */ printk("Emergency Sync\n"); emergency_sync_scheduled = EMERG_SYNC; wakeup_bdflush(0); break; case 'u': /* U -- emergency remount R/O */ printk("Emergency Remount R/O\n"); emergency_sync_scheduled = EMERG_REMOUNT; wakeup_bdflush(0); break; case 'p': /* P -- show PC */ printk("Show Regs\n"); if (pt_regs) show_regs(pt_regs); break; case 't': /* T -- show task info */ printk("Show State\n"); show_state(); break; case 'm': /* M -- show memory info */ printk("Show Memory\n"); show_mem(); break; case '0' ... '9': /* 0-9 -- set console logging level */ orig_log_level = key - '0'; printk("Log level set to %d\n", orig_log_level); break; case 'e': /* E -- terminate all user processes */ printk("Terminate All Tasks\n"); send_sig_all(SIGTERM, 0); orig_log_level = 8; /* We probably have killed syslogd */ break; case 'i': /* I -- kill all user processes */ printk("Kill All Tasks\n"); send_sig_all(SIGKILL, 0); orig_log_level = 8; break; case 'l': /* L -- kill all processes including init */ printk("Kill ALL Tasks (even init)\n"); send_sig_all(SIGKILL, 1); orig_log_level = 8; break; default: /* Unknown: help */ if (kbd) printk("unRaw "); #ifdef CONFIG_VT if (tty) printk("saK "); #endif printk("Boot "); if (sysrq_power_off) printk("Off "); printk("Sync Unmount showPc showTasks showMem loglevel0-8 tErm kIll killalL\n"); /* Don't use 'A' as it's handled specially on the Sparc */ } console_loglevel = orig_log_level; }
static void sysrq_handle_SAK(int key, struct tty_struct *tty) { if (tty) do_SAK(tty); reset_vc(vc_cons[fg_console].d); }