1 /* 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1992 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department and Ralph Campbell. 9 * 10 * %sccs.include.redist.c% 11 * 12 * from: Utah $Hdr: cons.c 1.1 90/07/09$ 13 * 14 * @(#)cons.c 7.1 (Berkeley) 01/07/92 15 */ 16 17 #include "param.h" 18 #include "proc.h" 19 #include "systm.h" 20 #include "buf.h" 21 #include "ioctl.h" 22 #include "tty.h" 23 #include "file.h" 24 #include "conf.h" 25 26 #include "../include/machMon.h" 27 28 /* 29 * Console output may be redirected to another tty 30 * (e.g. a window); if so, constty will point to the current 31 * virtual console. 32 */ 33 struct tty *constty; /* virtual console output device */ 34 35 /* 36 * Get character from console. 37 */ 38 cngetc() 39 { 40 int (*f)() = (int (*)())MACH_MON_GETCHAR; 41 42 return (*f)(); 43 } 44 45 #include "pm.h" 46 47 /* 48 * Print a character on console. 49 */ 50 cnputc(c) 51 register int c; 52 { 53 #if NPM > 0 54 pmPutc(c); 55 #else 56 int s; 57 void (*f)() = (void (*)())MACH_MON_PUTCHAR; 58 59 s = splhigh(); 60 (*f)(c); 61 splx(s); 62 #endif 63 } 64