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/isa/syscons.h | |
parent | 271727741c72633cfbf750b45b4cb8ba1b7a9aae (diff) | |
download | FreeBSD-src-a1160c985757fb579a45c139d8649181ffde94dc.zip FreeBSD-src-a1160c985757fb579a45c139d8649181ffde94dc.tar.gz |
Merge with the latest i386 syscons.
Diffstat (limited to 'sys/isa/syscons.h')
-rw-r--r-- | sys/isa/syscons.h | 94 |
1 files changed, 63 insertions, 31 deletions
diff --git a/sys/isa/syscons.h b/sys/isa/syscons.h index dc57f07..e8f9461 100644 --- a/sys/isa/syscons.h +++ b/sys/isa/syscons.h @@ -1,18 +1,18 @@ /*- - * Copyright (c) 1995-1997 Søren Schmidt + * Copyright (c) 1995-1998 Søren Schmidt * 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 - * in this position and unchanged. + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. * 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 + * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -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/isa syscons.h,v 1.39 + * $Id: syscons.h,v 1.40 1998/08/06 09:15:53 dfr Exp $ + * from: i386/isa syscons.h,v 1.40 */ #ifndef _I386_ISA_SYSCONS_H_ @@ -77,6 +77,9 @@ #define MOUSE_MOVED 0x01000 #define MOUSE_CUTTING 0x02000 #define MOUSE_VISIBLE 0x04000 +#define GRAPHICS_MODE 0x08000 +#define PIXEL_MODE 0x10000 +#define SAVER_RUNNING 0x20000 /* configuration flags */ #define VISUAL_BELL 0x00001 @@ -86,6 +89,7 @@ #define XT_KEYBD 0x00010 #define KBD_NORESET 0x00020 #define QUIET_BELL 0x00040 +#define VESA800X600 0x00080 /* attribute flags */ #define NORMAL_ATTR 0x00 @@ -96,9 +100,6 @@ #define FOREGROUND_CHANGED 0x10 #define BACKGROUND_CHANGED 0x20 -/* video hardware memory addresses */ -#define VIDEOMEM 0x000A0000 - /* misc defines */ #define FALSE 0 #define TRUE 1 @@ -116,20 +117,6 @@ #define FONT_14 4 #define FONT_16 8 -/* defines related to hardware addresses */ -#define MONO_BASE 0x3B4 /* crt controller base mono */ -#define COLOR_BASE 0x3D4 /* crt controller base color */ -#define MISC 0x3C2 /* misc output register */ -#define ATC IO_VGA+0x00 /* attribute controller */ -#define TSIDX IO_VGA+0x04 /* timing sequencer idx */ -#define TSREG IO_VGA+0x05 /* timing sequencer data */ -#define PIXMASK IO_VGA+0x06 /* pixel write mask */ -#define PALRADR IO_VGA+0x07 /* palette read address */ -#define PALWADR IO_VGA+0x08 /* palette write address */ -#define PALDATA IO_VGA+0x09 /* palette data register */ -#define GDCIDX IO_VGA+0x0E /* graph data controller idx */ -#define GDCREG IO_VGA+0x0F /* graph data controller data */ - /* special characters */ #define cntlc 0x03 #define cntld 0x04 @@ -153,6 +140,7 @@ typedef struct term_stat { } term_stat; typedef struct scr_stat { + int adp; /* video adapter index */ u_short *scr_buf; /* buffer when off screen */ int xpos; /* current X position */ int ypos; /* current Y position */ @@ -162,6 +150,8 @@ typedef struct scr_stat { int ysize; /* Y text size */ int xpixel; /* X graphics size */ int ypixel; /* Y graphics size */ + int xoff; /* X offset in pixel mode */ + int yoff; /* Y offset in pixel mode */ int font_size; /* fontsize in Y direction */ int start; /* modified area start */ int end; /* modified area end */ @@ -200,7 +190,8 @@ typedef struct scr_stat { struct apmhook r_hook; /* reconfiguration support */ #endif #ifdef SC_SPLASH_SCREEN - u_char splash_save_mode; /* saved mode for splash screen */ + int splash_save_mode; /* saved mode for splash screen */ + int splash_save_status; /* saved status for splash screen */ #endif } scr_stat; @@ -209,18 +200,59 @@ typedef struct default_attr { int rev_color; /* reverse hardware color */ } default_attr; + +#define ISTEXTSC(scp) (!((scp)->status \ + & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE))) +#define ISGRAPHSC(scp) (((scp)->status \ + & (UNKNOWN_MODE | GRAPHICS_MODE))) +#define ISPIXELSC(scp) (((scp)->status \ + & (UNKNOWN_MODE | GRAPHICS_MODE | PIXEL_MODE))\ + == PIXEL_MODE) +#define ISUNKNOWNSC(scp) ((scp)->status & UNKNOWN_MODE) + +#define ISFONTAVAIL(af) ((af) & V_ADP_FONT) +#define ISMOUSEAVAIL(af) ((af) & V_ADP_FONT) +#define ISPALAVAIL(af) ((af) & V_ADP_PALETTE) + /* misc prototypes used by different syscons related LKM's */ -void set_border(u_char color); -void set_mode(scr_stat *scp); -void copy_font(int operation, int font_type, char* font_image); -void load_palette(char *palette); + +/* syscons.c */ +extern int (*sc_user_ioctl)(dev_t dev, int cmd, caddr_t data, int flag, + struct proc *p); + +int set_mode(scr_stat *scp); +scr_stat *sc_get_scr_stat(dev_t dev); + +void copy_font(scr_stat *scp, int operation, int font_size, u_char *font_image); +#define save_palette(scp, pal) (*biosvidsw.save_palette)((scp)->adp, pal) +#define load_palette(scp, pal) (*biosvidsw.load_palette)((scp)->adp, pal) +#define set_border(scp, col) (*biosvidsw.set_border)((scp)->adp, col) +#define get_adapter(scp) (*biosvidsw.adapter)((scp)->adp) + int add_scrn_saver(void (*this)(int)); int remove_scrn_saver(void (*this)(int)); +void sc_clear_screen(scr_stat *scp); +void sc_move_mouse(scr_stat *scp, int x, int y); +int sc_clean_up(scr_stat *scp); +void sc_alloc_scr_buffer(scr_stat *scp, int wait, int clear); +void sc_alloc_cut_buffer(scr_stat *scp, int wait); +void sc_alloc_history_buffer(scr_stat *scp, int lines, int extra, int wait); + +/* scvidctl.c */ +int sc_set_text_mode(scr_stat *scp, struct tty *tp, int mode, + int xsize, int ysize, int fontsize); +int sc_set_graphics_mode(scr_stat *scp, struct tty *tp, int mode); +int sc_set_pixel_mode(scr_stat *scp, struct tty *tp, + int xsize, int ysize, int fontsize); +int sc_vid_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, + struct proc *p); + #ifdef SC_SPLASH_SCREEN -void splash(int); -int splash_load(void); -int splash_unload(void); +/* splash.c */ +void scsplash(int); +int scsplash_load(scr_stat *scp); +int scsplash_unload(scr_stat *scp); #endif #endif /* !_I386_ISA_SYSCONS_H_ */ |