1 /* $NetBSD: console.h,v 1.2 2007/02/21 22:59:41 thorpej Exp $ */
4 * Copyright (c) 2004, 2005 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #define FB_LINEBYTES 2048
34 #define FB_HEIGHT 1024
36 #define CONS_WIDTH (FB_WIDTH / ROM_FONT_WIDTH)
37 #define CONS_HEIGHT (FB_HEIGHT / ROM_FONT_HEIGHT)
61 CONS_ROM
, /* ROM console I/O */
62 CONS_FB_KSEG2
, /* direct fb device access via KSEG2 */
63 CONS_FB_KSEG1
, /* direct fb device access via KSEG1 */
64 CONS_SIO1
, /* serial console port 1 */
65 CONS_SIO2
, /* serial console port 2 */
70 void (*putc
)(int, int, int);
74 void (*cursor
)(int, int);
76 enum console_type type
;
77 bool erace_previous_cursor
;
89 volatile uint8_t *status
;
90 volatile uint8_t *data
;
91 const uint8_t *normal
;
94 const uint8_t *capslock
;
100 volatile uint8_t *csr
;
101 volatile uint8_t *data
;
105 void fb_set_addr(uint32_t, uint32_t, uint32_t);
106 void *fb_get_addr(void);
108 void fb_scroll(void);
109 void fb_drawchar(int, int, int);
110 void fb_drawfont(int, int, uint16_t *);
111 void fb_drawcursor(int, int);
112 void fb_clear(int, int, int, int, int);
113 void fb_copy(int, int, int, int, int, int);
114 void fb_active(bool);
116 void zskbd_set_addr(uint32_t, uint32_t);
117 int zskbd_getc(void);
118 int zskbd_scan(void);
119 void zskbd_print_keyscan(int);
121 void zs_set_addr(uint32_t, uint32_t, int);
123 void cons_rom_scroll(void);
124 void cons_rom_init(void);
127 enum console_type
console_type(void);
128 void console_init(void);
129 void console_cursor(bool);
133 extern struct cons cons
;
134 extern struct zskbd zskbd
;