scterm-teken.c (197539) | scterm-teken.c (199171) |
---|---|
1/*- 2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> 3 * All rights reserved. 4 * 5 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1999 Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> 3 * All rights reserved. 4 * 5 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org> 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/syscons/scterm-teken.c 197539 2009-09-27 18:19:41Z ed $"); | 31__FBSDID("$FreeBSD: head/sys/dev/syscons/scterm-teken.c 199171 2009-11-11 08:20:19Z ed $"); |
32 33#include "opt_syscons.h" 34#include "opt_teken.h" 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/kernel.h> 39#include <sys/module.h> 40#include <sys/consio.h> | 32 33#include "opt_syscons.h" 34#include "opt_teken.h" 35 36#include <sys/param.h> 37#include <sys/systm.h> 38#include <sys/kernel.h> 39#include <sys/module.h> 40#include <sys/consio.h> |
41#include <sys/kbio.h> |
|
41 42#if defined(__sparc64__) || defined(__powerpc__) 43#include <machine/sc_machdep.h> 44#else 45#include <machine/pc/display.h> 46#endif 47 48#include <dev/syscons/syscons.h> 49 50#include <teken/teken.h> 51 52static void scteken_revattr(unsigned char, teken_attr_t *); 53static unsigned int scteken_attr(const teken_attr_t *); 54 | 42 43#if defined(__sparc64__) || defined(__powerpc__) 44#include <machine/sc_machdep.h> 45#else 46#include <machine/pc/display.h> 47#endif 48 49#include <dev/syscons/syscons.h> 50 51#include <teken/teken.h> 52 53static void scteken_revattr(unsigned char, teken_attr_t *); 54static unsigned int scteken_attr(const teken_attr_t *); 55 |
55static sc_term_init_t scteken_init; 56static sc_term_term_t scteken_term; 57static sc_term_puts_t scteken_puts; 58static sc_term_ioctl_t scteken_ioctl; 59static sc_term_default_attr_t scteken_default_attr; 60static sc_term_clear_t scteken_clear; 61static sc_term_input_t scteken_input; 62static void scteken_nop(void); | 56static sc_term_init_t scteken_init; 57static sc_term_term_t scteken_term; 58static sc_term_puts_t scteken_puts; 59static sc_term_ioctl_t scteken_ioctl; 60static sc_term_default_attr_t scteken_default_attr; 61static sc_term_clear_t scteken_clear; 62static sc_term_input_t scteken_input; 63static sc_term_fkeystr_t scteken_fkeystr; 64static void scteken_nop(void); |
63 64typedef struct { 65 teken_t ts_teken; 66 int ts_busy; 67} teken_stat; 68 69static teken_stat reserved_teken_stat; 70 --- 8 unchanged lines hidden (view full) --- 79 scteken_term, 80 scteken_puts, 81 scteken_ioctl, 82 (sc_term_reset_t *)scteken_nop, 83 scteken_default_attr, 84 scteken_clear, 85 (sc_term_notify_t *)scteken_nop, 86 scteken_input, | 65 66typedef struct { 67 teken_t ts_teken; 68 int ts_busy; 69} teken_stat; 70 71static teken_stat reserved_teken_stat; 72 --- 8 unchanged lines hidden (view full) --- 81 scteken_term, 82 scteken_puts, 83 scteken_ioctl, 84 (sc_term_reset_t *)scteken_nop, 85 scteken_default_attr, 86 scteken_clear, 87 (sc_term_notify_t *)scteken_nop, 88 scteken_input, |
89 scteken_fkeystr, |
|
87}; 88 89SCTERM_MODULE(scteken, sc_term_scteken); 90 91static tf_bell_t scteken_bell; 92static tf_cursor_t scteken_cursor; 93static tf_putchar_t scteken_putchar; 94static tf_fill_t scteken_fill; --- 141 unchanged lines hidden (view full) --- 236 237static int 238scteken_input(scr_stat *scp, int c, struct tty *tp) 239{ 240 241 return FALSE; 242} 243 | 90}; 91 92SCTERM_MODULE(scteken, sc_term_scteken); 93 94static tf_bell_t scteken_bell; 95static tf_cursor_t scteken_cursor; 96static tf_putchar_t scteken_putchar; 97static tf_fill_t scteken_fill; --- 141 unchanged lines hidden (view full) --- 239 240static int 241scteken_input(scr_stat *scp, int c, struct tty *tp) 242{ 243 244 return FALSE; 245} 246 |
247static const char * 248scteken_fkeystr(scr_stat *scp, int c) 249{ 250 teken_stat *ts = scp->ts; 251 unsigned int k; 252 253 switch (c) { 254 case FKEY | F(1): case FKEY | F(2): case FKEY | F(3): 255 case FKEY | F(4): case FKEY | F(5): case FKEY | F(6): 256 case FKEY | F(7): case FKEY | F(8): case FKEY | F(9): 257 case FKEY | F(10): case FKEY | F(11): case FKEY | F(12): 258 k = TKEY_F1 + c - (FKEY | F(1)); 259 break; 260 case FKEY | F(49): 261 k = TKEY_HOME; 262 break; 263 case FKEY | F(50): 264 k = TKEY_UP; 265 break; 266 case FKEY | F(51): 267 k = TKEY_PAGE_UP; 268 break; 269 case FKEY | F(53): 270 k = TKEY_LEFT; 271 break; 272 case FKEY | F(55): 273 k = TKEY_RIGHT; 274 break; 275 case FKEY | F(57): 276 k = TKEY_END; 277 break; 278 case FKEY | F(58): 279 k = TKEY_DOWN; 280 break; 281 case FKEY | F(59): 282 k = TKEY_PAGE_DOWN; 283 break; 284 case FKEY | F(60): 285 k = TKEY_INSERT; 286 break; 287 case FKEY | F(61): 288 k = TKEY_DELETE; 289 break; 290 default: 291 return (NULL); 292 } 293 294 return (teken_get_sequence(&ts->ts_teken, k)); 295} 296 |
|
244static void 245scteken_nop(void) 246{ 247 248} 249 250/* 251 * libteken routines. --- 408 unchanged lines hidden --- | 297static void 298scteken_nop(void) 299{ 300 301} 302 303/* 304 * libteken routines. --- 408 unchanged lines hidden --- |