linux/drivers/video/console/vgacon.c

/*
 *  linux/drivers/video/vgacon.c -- Low level VGA based console driver
 *
 *	Created 28 Sep 1997 by Geert Uytterhoeven
 *
 *	Rewritten by Martin Mares <[email protected]>, July 1998
 *
 *  This file is based on the old console.c, vga.c and vesa_blank.c drivers.
 *
 *	Copyright (C) 1991, 1992  Linus Torvalds
 *			    1995  Jay Estabrook
 *
 *	User definable mapping table and font loading by Eugene G. Crosser,
 *	<[email protected]>
 *
 *	Improved loadable font/UTF-8 support by H. Peter Anvin
 *	Feb-Sep 1995 <[email protected]>
 *
 *	Colour palette handling, by Simon Tatham
 *	17-Jun-95 <[email protected]>
 *
 *	if 512 char mode is already enabled don't re-enable it,
 *	because it causes screen to flicker, by Mitja Horvat
 *	5-May-96 <[email protected]>
 *
 *	Use 2 outw instead of 4 outb_p to reduce erroneous text
 *	flashing on RHS of screen during heavy console scrolling .
 *	Oct 1996, Paul Gortmaker.
 *
 *
 *  This file is subject to the terms and conditions of the GNU General Public
 *  License.  See the file COPYING in the main directory of this archive for
 *  more details.
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/kd.h>
#include <linux/slab.h>
#include <linux/vt_kern.h>
#include <linux/sched.h>
#include <linux/selection.h>
#include <linux/spinlock.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/screen_info.h>
#include <video/vga.h>
#include <asm/io.h>

static DEFINE_RAW_SPINLOCK(vga_lock);
static int cursor_size_lastfrom;
static int cursor_size_lastto;
static u32 vgacon_xres;
static u32 vgacon_yres;
static struct vgastate vgastate;

#define BLANK

#define VGA_FONTWIDTH
/*
 *  Interface used by the world
 */

static bool vgacon_set_origin(struct vc_data *c);

static struct uni_pagedict *vgacon_uni_pagedir;
static int vgacon_refcount;

/* Description of the hardware situation */
static unsigned long	vga_vram_base		__read_mostly;	/* Base of video memory */
static unsigned long	vga_vram_end		__read_mostly;	/* End of video memory */
static unsigned int	vga_vram_size		__read_mostly;	/* Size of video memory */
static u16		vga_video_port_reg	__read_mostly;	/* Video register select port */
static u16		vga_video_port_val	__read_mostly;	/* Video register value port */
static unsigned int	vga_video_num_columns;			/* Number of text columns */
static unsigned int	vga_video_num_lines;			/* Number of text lines */
static bool		vga_can_do_color;			/* Do we support colors? */
static unsigned int	vga_default_font_height __read_mostly;	/* Height of default screen font */
static unsigned char	vga_video_type		__read_mostly;	/* Card type */
static enum vesa_blank_mode vga_vesa_blanked;
static bool 		vga_palette_blanked;
static bool 		vga_is_gfx;
static bool 		vga_512_chars;
static int 		vga_video_font_height;
static int 		vga_scan_lines		__read_mostly;
static unsigned int 	vga_rolled_over; /* last vc_origin offset before wrap */

static struct screen_info *vga_si;

static bool vga_hardscroll_enabled;
static bool vga_hardscroll_user_enable =;

static int __init no_scroll(char *str)
{}

__setup();

/*
 * By replacing the four outb_p with two back to back outw, we can reduce
 * the window of opportunity to see text mislocated to the RHS of the
 * console during heavy scrolling activity. However there is the remote
 * possibility that some pre-dinosaur hardware won't like the back to back
 * I/O. Since the Xservers get away with it, we should be able to as well.
 */
static inline void write_vga(unsigned char reg, unsigned int val)
{}

static inline void vga_set_mem_top(struct vc_data *c)
{}

static void vgacon_scrolldelta(struct vc_data *c, int lines)
{}

static void vgacon_restore_screen(struct vc_data *c)
{}

static const char *vgacon_startup(void)
{}

static void vgacon_init(struct vc_data *c, bool init)
{}

static void vgacon_deinit(struct vc_data *c)
{}

static u8 vgacon_build_attr(struct vc_data *c, u8 color,
			    enum vc_intensity intensity,
			    bool blink, bool underline, bool reverse,
			    bool italic)
{}

static void vgacon_invert_region(struct vc_data *c, u16 * p, int count)
{}

static void vgacon_set_cursor_size(int from, int to)
{}

static void vgacon_cursor(struct vc_data *c, bool enable)
{}

static void vgacon_doresize(struct vc_data *c,
		unsigned int width, unsigned int height)
{}

static bool vgacon_switch(struct vc_data *c)
{}

static void vga_set_palette(struct vc_data *vc, const unsigned char *table)
{}

static void vgacon_set_palette(struct vc_data *vc, const unsigned char *table)
{}

/* structure holding original VGA register settings */
static struct {} vga_state;

static void vga_vesa_blank(struct vgastate *state, enum vesa_blank_mode mode)
{}

static void vga_vesa_unblank(struct vgastate *state)
{}

static void vga_pal_blank(struct vgastate *state)
{}

static bool vgacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
			 bool mode_switch)
{}

/*
 * PIO_FONT support.
 *
 * The font loading code goes back to the codepage package by
 * Joel Hoffman ([email protected]). (He reports that the original
 * reference is: "From: p. 307 of _Programmer's Guide to PC & PS/2
 * Video Systems_ by Richard Wilton. 1987.  Microsoft Press".)
 *
 * Change for certain monochrome monitors by Yury Shevchuck
 * ([email protected]).
 */

#define colourmap
/* Pauline Middelink <[email protected]> reports that we
   should use 0xA0000 for the bwmap as well.. */
#define blackwmap
#define cmapsz

static int vgacon_do_font_op(struct vgastate *state, char *arg, int set,
		bool ch512)
{}

/*
 * Adjust the screen to fit a font of a certain height
 */
static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight)
{}

static int vgacon_font_set(struct vc_data *c, const struct console_font *font,
			   unsigned int vpitch, unsigned int flags)
{}

static int vgacon_font_get(struct vc_data *c, struct console_font *font, unsigned int vpitch)
{}

static int vgacon_resize(struct vc_data *c, unsigned int width,
			 unsigned int height, bool from_user)
{}

static bool vgacon_set_origin(struct vc_data *c)
{}

static void vgacon_save_screen(struct vc_data *c)
{}

static bool vgacon_scroll(struct vc_data *c, unsigned int t, unsigned int b,
		enum con_scroll dir, unsigned int lines)
{}

/*
 *  The console `switch' structure for the VGA based console
 */

static void vgacon_clear(struct vc_data *vc, unsigned int sy, unsigned int sx,
			 unsigned int width) {}
static void vgacon_putcs(struct vc_data *vc, const u16 *s, unsigned int count,
			 unsigned int ypos, unsigned int xpos) {}

const struct consw vga_con =;
EXPORT_SYMBOL();

void vgacon_register_screen(struct screen_info *si)
{}

MODULE_DESCRIPTION();
MODULE_LICENSE();