diff options
author | dfr <dfr@FreeBSD.org> | 1998-09-17 09:38:36 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1998-09-17 09:38:36 +0000 |
commit | a1160c985757fb579a45c139d8649181ffde94dc (patch) | |
tree | b3226346dfbf2849b25075e16560d6d27ed46ae0 /sys/alpha | |
parent | 271727741c72633cfbf750b45b4cb8ba1b7a9aae (diff) | |
download | FreeBSD-src-a1160c985757fb579a45c139d8649181ffde94dc.zip FreeBSD-src-a1160c985757fb579a45c139d8649181ffde94dc.tar.gz |
Merge with the latest i386 syscons.
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/conf/files.alpha | 4 | ||||
-rw-r--r-- | sys/alpha/include/console.h | 129 | ||||
-rw-r--r-- | sys/alpha/include/pc/bios.h | 8 | ||||
-rw-r--r-- | sys/alpha/include/pc/vesa.h | 128 |
4 files changed, 262 insertions, 7 deletions
diff --git a/sys/alpha/conf/files.alpha b/sys/alpha/conf/files.alpha index 1448d7b..344d6f4 100644 --- a/sys/alpha/conf/files.alpha +++ b/sys/alpha/conf/files.alpha @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $Id: files.alpha,v 1.8 1998/09/07 07:29:30 dfr Exp $ +# $Id: files.alpha,v 1.9 1998/09/16 08:22:09 dfr Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -138,4 +138,6 @@ isa/sio.c optional sio device-driver isa/kbdio.c optional psm device-driver isa/psm.c optional psm device-driver isa/kbdio.c optional sc device-driver +isa/videoio.c optional sc device-driver isa/syscons.c optional sc device-driver +isa/scvidctl.c optional sc device-driver diff --git a/sys/alpha/include/console.h b/sys/alpha/include/console.h index efcf45f..d747976 100644 --- a/sys/alpha/include/console.h +++ b/sys/alpha/include/console.h @@ -25,8 +25,8 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id$ - * from: i386/include console.h,v 1.38 + * $Id: console.h,v 1.39 1998/08/06 09:15:52 dfr Exp $ + * from: i386/include console.h,v 1.39 */ #ifndef _MACHINE_CONSOLE_H_ @@ -52,6 +52,7 @@ #define KDGETLED _IOR('K', 65, int) #define KDSETLED _IO('K', 66 /*, int */) #define KDSETRAD _IO('K', 67 /*, int */) +#define KDRASTER _IOW('K', 100, scr_size_t) #define GETFKEY _IOWR('k', 0, fkeyarg_t) #define SETFKEY _IOWR('k', 1, fkeyarg_t) @@ -85,6 +86,11 @@ #define GIO_FONT8x16 _IOR('c', 69, fnt16_t) #define CONS_GETINFO _IOWR('c', 73, vid_info_t) #define CONS_GETVERS _IOR('c', 74, int) +#define CONS_CURRENTADP _IOR('c', 100, int) +#define CONS_ADPINFO _IOWR('c', 101, video_adapter_t) +#define CONS_MODEINFO _IOWR('c', 102, video_info_t) +#define CONS_FINDMODE _IOWR('c', 103, video_info_t) +#define CONS_SETWINORG _IO('c', 104 /* u_int */) /* CONS_SAVERMODE */ #define CONS_LKM_SAVER 0 @@ -170,6 +176,7 @@ struct mouse_info { #define KD_TEXT0 0 /* ditto */ #define KD_TEXT1 2 /* set text mode !restore fonts */ #define KD_GRAPHICS 1 /* set graphics mode */ +#define KD_PIXEL 3 /* set pixel mode */ #define K_RAW 0 /* keyboard returns scancodes */ #define K_XLATE 1 /* keyboard returns ascii */ @@ -264,6 +271,55 @@ struct ssaver { long time; }; +/* adapter infromation block */ +struct video_adapter { + int va_index; + int va_type; + int va_flags; +#define V_ADP_COLOR (1<<0) +#define V_ADP_MODECHANGE (1<<1) +#define V_ADP_STATESAVE (1<<2) +#define V_ADP_STATELOAD (1<<3) +#define V_ADP_FONT (1<<4) +#define V_ADP_PALETTE (1<<5) +#define V_ADP_BORDER (1<<6) +#define V_ADP_VESA (1<<7) + int va_crtc_addr; + u_int va_window; /* virtual address */ + size_t va_window_size; + size_t va_window_gran; + u_int va_buffer; /* virtual address */ + size_t va_buffer_size; + int va_initial_mode; + int va_initial_bios_mode; + int va_mode; +}; + +#define V_ADP_PRIMARY 0 +#define V_ADP_SECONDARY 1 + +/* video mode information block */ +struct video_info { + int vi_mode; + int vi_flags; +#define V_INFO_COLOR (1<<0) +#define V_INFO_GRAPHICS (1<<1) +#define V_INFO_LENEAR (1<<2) +#define V_INFO_VESA (1<<3) + int vi_width; + int vi_height; + int vi_cwidth; + int vi_cheight; + int vi_depth; + int vi_planes; + u_int vi_window; /* physical address */ + size_t vi_window_size; + size_t vi_window_gran; + u_int vi_buffer; /* physical address */ + size_t vi_buffer_size; + /* XXX pixel format, memory model,... */ +}; + typedef struct accentmap accentmap_t; typedef struct fkeytab fkeytab_t; typedef struct fkeyarg fkeyarg_t; @@ -274,6 +330,9 @@ typedef struct {char fnt8x8[8*256];} fnt8_t; typedef struct {char fnt8x14[14*256];} fnt14_t; typedef struct {char fnt8x16[16*256];} fnt16_t; typedef struct ssaver ssaver_t; +typedef struct video_adapter video_adapter_t; +typedef struct video_info video_info_t; +typedef struct {int scr_size[3];} scr_size_t; /* defines for "special" keys (spcl bit set in keymap) */ #define NOP 0x00 /* nothing (dead key) */ @@ -379,8 +438,6 @@ typedef struct ssaver ssaver_t; #define M_HGC_P1 0xe1 /* hercules graphics - page 1 @ B8000 */ #define M_MCA_MODE 0xff /* monochrome adapter mode */ -#define M_VESA_BASE 0x100 /* VESA mode number base */ - #define SW_PC98_80x25 _IO('S', M_PC98_80x25) #define SW_PC98_80x30 _IO('S', M_PC98_80x30) #define SW_B40x25 _IO('S', M_B40x25) @@ -422,4 +479,68 @@ typedef struct ssaver ssaver_t; #define SW_VGA_CG640 _IO('S', M_VGA_CG640) #define SW_VGA_MODEX _IO('S', M_VGA_MODEX) +#define M_VESA_BASE 0x100 /* VESA mode number base */ + +#define M_VESA_CG640x400 0x100 /* 640x400, 256 color */ +#define M_VESA_CG640x480 0x101 /* 640x480, 256 color */ +#define M_VESA_800x600 0x102 /* 800x600, 16 color */ +#define M_VESA_CG800x600 0x103 /* 800x600, 256 color */ +#define M_VESA_1024x768 0x104 /* 1024x768, 16 color */ +#define M_VESA_CG1024x768 0x105 /* 1024x768, 256 color */ +#define M_VESA_1280x1024 0x106 /* 1280x1024, 16 color */ +#define M_VESA_CG1280x1024 0x107 /* 1280x1024, 256 color */ +#define M_VESA_C80x60 0x108 /* 8x8 font */ +#define M_VESA_C132x25 0x109 /* 8x16 font */ +#define M_VESA_C132x43 0x10a /* 8x14 font */ +#define M_VESA_C132x50 0x10b /* 8x8 font */ +#define M_VESA_C132x60 0x10c /* 8x8 font */ +#define M_VESA_32K_320 0x10d /* 320x200, 5:5:5 */ +#define M_VESA_64K_320 0x10e /* 320x200, 5:6:5 */ +#define M_VESA_FULL_320 0x10f /* 320x200, 8:8:8 */ +#define M_VESA_32K_640 0x110 /* 640x480, 5:5:5 */ +#define M_VESA_64K_640 0x111 /* 640x480, 5:6:5 */ +#define M_VESA_FULL_640 0x112 /* 640x480, 8:8:8 */ +#define M_VESA_32K_800 0x113 /* 800x600, 5:5:5 */ +#define M_VESA_64K_800 0x114 /* 800x600, 5:6:5 */ +#define M_VESA_FULL_800 0x115 /* 800x600, 8:8:8 */ +#define M_VESA_32K_1024 0x116 /* 1024x768, 5:5:5 */ +#define M_VESA_64K_1024 0x117 /* 1024x768, 5:6:5 */ +#define M_VESA_FULL_1024 0x118 /* 1024x768, 8:8:8 */ +#define M_VESA_32K_1280 0x119 /* 1280x1024, 5:5:5 */ +#define M_VESA_64K_1280 0x11a /* 1280x1024, 5:6:5 */ +#define M_VESA_FULL_1280 0x11b /* 1280x1024, 8:8:8 */ +#define M_VESA_MODE_MAX 0x1ff +#define M_VESA_USER 0x1ff + +#define SW_VESA_CG640x400 _IO('V', M_VESA_CG640x400 - M_VESA_BASE) +#define SW_VESA_CG640x480 _IO('V', M_VESA_CG640x480 - M_VESA_BASE) +#define SW_VESA_800x600 _IO('V', M_VESA_800x600 - M_VESA_BASE) +#define SW_VESA_CG800x600 _IO('V', M_VESA_CG800x600 - M_VESA_BASE) +#define SW_VESA_1024x768 _IO('V', M_VESA_1024x768 - M_VESA_BASE) +#define SW_VESA_CG1024x768 _IO('V', M_VESA_CG1024x768 - M_VESA_BASE) +#define SW_VESA_1280x1024 _IO('V', M_VESA_1280x1024 - M_VESA_BASE) +#define SW_VESA_CG1280x1024 _IO('V', M_VESA_CG1280x1024 - M_VESA_BASE) +#define SW_VESA_C80x60 _IO('V', M_VESA_C80x60 - M_VESA_BASE) +#define SW_VESA_C132x25 _IO('V', M_VESA_C132x25 - M_VESA_BASE) +#define SW_VESA_C132x43 _IO('V', M_VESA_C132x43 - M_VESA_BASE) +#define SW_VESA_C132x50 _IO('V', M_VESA_C132x50 - M_VESA_BASE) +#define SW_VESA_C132x60 _IO('V', M_VESA_C132x60 - M_VESA_BASE) +#define SW_VESA_32K_320 _IO('V', M_VESA_32K_320 - M_VESA_BASE) +#define SW_VESA_64K_320 _IO('V', M_VESA_64K_320 - M_VESA_BASE) +#define SW_VESA_FULL_320 _IO('V', M_VESA_FULL_320 - M_VESA_BASE) +#define SW_VESA_32K_640 _IO('V', M_VESA_32K_640 - M_VESA_BASE) +#define SW_VESA_64K_640 _IO('V', M_VESA_64K_640 - M_VESA_BASE) +#define SW_VESA_FULL_640 _IO('V', M_VESA_FULL_640 - M_VESA_BASE) +#define SW_VESA_32K_800 _IO('V', M_VESA_32K_800 - M_VESA_BASE) +#define SW_VESA_64K_800 _IO('V', M_VESA_64K_800 - M_VESA_BASE) +#define SW_VESA_FULL_800 _IO('V', M_VESA_FULL_800 - M_VESA_BASE) +#define SW_VESA_32K_1024 _IO('V', M_VESA_32K_1024 - M_VESA_BASE) +#define SW_VESA_64K_1024 _IO('V', M_VESA_64K_1024 - M_VESA_BASE) +#define SW_VESA_FULL_1024 _IO('V', M_VESA_FULL_1024 - M_VESA_BASE) +#define SW_VESA_32K_1280 _IO('V', M_VESA_32K_1280 - M_VESA_BASE) +#define SW_VESA_64K_1280 _IO('V', M_VESA_64K_1280 - M_VESA_BASE) +#define SW_VESA_FULL_1280 _IO('V', M_VESA_FULL_1280 - M_VESA_BASE) +#define SW_VESA_USER _IO('V', M_VESA_USER - M_VESA_BASE) + #endif /* !_MACHINE_CONSOLE_H_ */ + diff --git a/sys/alpha/include/pc/bios.h b/sys/alpha/include/pc/bios.h index 6e13692..5da68ea 100644 --- a/sys/alpha/include/pc/bios.h +++ b/sys/alpha/include/pc/bios.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: bios.h,v 1.3 1998/08/06 09:15:54 dfr Exp $ * from: i386/include/pc bios.h,v 1.2 */ @@ -71,9 +71,13 @@ struct bios32_args { }; extern void bios32(caddr_t func_addr, struct bios32_args *args); +#if 0 #define BIOS_PADDRTOVADDR(x) (((x) - ISA_HOLE_START) + atdevbase) #define BIOS_VADDRTOPADDR(x) (((x) - atdevbase) + ISA_HOLE_START) - +#else +#define BIOS_PADDRTOVADDR(x) (x) +#define BIOS_VADDRTOPADDR(x) (x) +#endif /* * System Management BIOS / Desktop Management Interface tables diff --git a/sys/alpha/include/pc/vesa.h b/sys/alpha/include/pc/vesa.h new file mode 100644 index 0000000..d5d19e4 --- /dev/null +++ b/sys/alpha/include/pc/vesa.h @@ -0,0 +1,128 @@ +/*- + * Copyright (c) 1998 Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + * from: i386/include/pc vesa.h,v 1.1 + */ + +#ifndef _MACHINE_PC_VESA_H +#define _MACHINE_PC_VESA_H + +struct vesa_info +{ + /* mandatory fields */ + u_int8_t v_sig[4] __attribute__ ((packed)); /* VESA */ + u_int16_t v_version __attribute__ ((packed)); /* ver in BCD */ + u_int32_t v_oemstr __attribute__ ((packed)); /* OEM string */ + u_int32_t v_flags __attribute__ ((packed)); /* flags */ +#define V_DAC8 (1<<0) +#define V_NONVGA (1<<1) +#define V_SNOW (1<<2) + u_int32_t v_modetable __attribute__ ((packed)); /* modes */ + u_int16_t v_memsize __attribute__ ((packed)); /* in 64K */ + /* 2.0 */ + u_int16_t v_revision __attribute__ ((packed)); /* software rev */ + u_int32_t v_venderstr __attribute__ ((packed)); /* vender */ + u_int32_t v_prodstr __attribute__ ((packed)); /* product name */ + u_int32_t v_revstr __attribute__ ((packed)); /* product rev */ +}; + +struct vesa_mode +{ + /* mandatory fields */ + u_int16_t v_modeattr; +#define V_MODESUPP (1<<0) /* VESA mode attributes */ +#define V_MODEOPTINFO (1<<1) +#define V_MODEBIOSOUT (1<<2) +#define V_MODECOLOR (1<<3) +#define V_MODEGRAPHICS (1<<4) +#define V_MODENONVGA (1<<5) +#define V_MODENONBANK (1<<6) +#define V_MODELFB (1<<7) +#define V_MODEVESA (1<<16) /* Private attributes */ + u_int8_t v_waattr; + u_int8_t v_wbattr; +#define V_WATTREXIST (1<<0) +#define V_WATTRREAD (1<<1) +#define V_WATTRWRITE (1<<2) + u_int16_t v_wgran; + u_int16_t v_wsize; + u_int16_t v_waseg; + u_int16_t v_wbseg; + u_int32_t v_posfunc; + u_int16_t v_bpscanline; + /* fields optional for 1.0/1.1 implementations */ + u_int16_t v_width; + u_int16_t v_height; + u_int8_t v_cwidth; + u_int8_t v_cheight; + u_int8_t v_planes; + u_int8_t v_bpp; + u_int8_t v_banks; + u_int8_t v_memmodel; +#define V_MMTEXT 0 +#define V_MMCGA 1 +#define V_MMHGC 2 +#define V_MMEGA 3 +#define V_MMPACKED 4 +#define V_MMSEQU256 5 +#define V_MMDIRCOLOR 6 +#define V_MMYUV 7 + u_int8_t v_banksize; + u_int8_t v_ipages; + u_int8_t v_reserved0; + /* fields for 1.2+ implementations */ + u_int8_t v_redmasksize; + u_int8_t v_redfieldpos; + u_int8_t v_greenmasksize; + u_int8_t v_greenfieldpos; + u_int8_t v_bluemasksize; + u_int8_t v_bluefieldpos; + u_int8_t v_resmasksize; + u_int8_t v_resfieldpos; + u_int8_t v_dircolormode; + /* 2.0 implementations */ + u_int32_t v_lfb; + u_int32_t v_offscreen; + u_int8_t v_offscreensize; +}; + +#ifdef KERNEL + +#define VESA_MODE(x) ((x) >= M_VESA_BASE) + +int vesa_load_ioctl(void); +int vesa_unload_ioctl(void); + +#ifndef VESA_MODULE +int vesa_load(void); +#endif + +#endif /* KERNEL */ + +#endif /* !_MACHINE_PC_VESA_H */ |