diff options
| author | Søren Schmidt <sos@FreeBSD.org> | 1998-09-15 18:16:39 +0000 |
|---|---|---|
| committer | Søren Schmidt <sos@FreeBSD.org> | 1998-09-15 18:16:39 +0000 |
| commit | a8445737e740901f5f2c8d24c12ef7fc8b00134e (patch) | |
| tree | a53608fb64d172c65ab81657e5c29cd53619eaab /sys/dev/syscons/syscons.h | |
| parent | 426281551d0ddb5449a06da3f89d80fe18e85c2d (diff) | |
Notes
Diffstat (limited to 'sys/dev/syscons/syscons.h')
| -rw-r--r-- | sys/dev/syscons/syscons.h | 92 |
1 files changed, 62 insertions, 30 deletions
diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index b23a2ae7c5da..315946b57305 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/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,7 +25,7 @@ * (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: syscons.h,v 1.38 1998/08/03 09:09:35 yokota Exp $ + * $Id$ */ #ifndef _I386_ISA_SYSCONS_H_ @@ -65,6 +65,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 @@ -74,6 +77,7 @@ #define XT_KEYBD 0x00010 #define KBD_NORESET 0x00020 #define QUIET_BELL 0x00040 +#define VESA800X600 0x00080 /* attribute flags */ #define NORMAL_ATTR 0x00 @@ -84,9 +88,6 @@ #define FOREGROUND_CHANGED 0x10 #define BACKGROUND_CHANGED 0x20 -/* video hardware memory addresses */ -#define VIDEOMEM 0x000A0000 - /* misc defines */ #define FALSE 0 #define TRUE 1 @@ -104,20 +105,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 @@ -141,6 +128,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 */ @@ -150,6 +138,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 */ @@ -186,7 +176,8 @@ typedef struct scr_stat { int history_size; /* size of history buffer */ struct apmhook r_hook; /* reconfiguration support */ #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; @@ -195,18 +186,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_ */ |
