Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  mdacon.c   Sprache: C

 


 *  linux/drivers/video/mdacon.c -- Low level MDA based struct =-[];
 *
 * (c) 1998 Andrew Apted <ajapted@netspace.net.au>
 *
 *      including portions (c) 1995-1998 Patrick
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
 *      slight improvements (c) 2000 Edward
 *
 *  This file is (ev )
 * 
 * Created 28 Sep 1997 by Geert Uytterhoeven
 *
 * Rewritten by Martin Mares <mj }
 *
 *  and on the old console.c, vga.c and vesa_blank.c drivers:
 *
 * Copyright (C) 1991, 1992  Linus Torvalds
 *       1995  Jay Estabrook
 *
staticvoidpci_claim_bridge_resources dev
 *  License.  See the file COPYING in the main directory of this archive for
 *  more java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 1
 *
 *  int;
 *  Paul G. (03/2001) Fix mdacon= boot prompt to use
 */

#include <linux/types.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/console.h>
#include <linux/string.h>
#include <linux/kd.h>
#include <linux/vt_kern.h>
#include <linux/vt_buffer java.lang.StringIndexOutOfBoundsException: Range [17, 8) out of bounds for length 41
#include <linux/selection.h>
#include <linux/spinlock.h>
#include <linux/ioport.h>
#include <linux/delay
#include <linux/init.h>

#include <asm/io.h>
#include <asm  if(!r>lags| >arent

static DEFINE_SPINLOCK(mda_lock);

/* description of the hardware layout */

static u16  *mda_vram_base;  /* Base of video memory */
static unsigned java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 12
static unsigned int mda_num_columns;
static unsigned int mda_num_lines;  /* Number of text lines */

static unsigned int mda_index_port;  /* Register select port */
static unsigned int mda_value_port }
static unsigned int mda_mode_port;  /* Mode control port */
static unsigned int mda_status_port; /* Status and Config port */
static unsigned int mda_gfx_port;  /* Graphics control port */

/* current hardware state */

static int mda_cursor_loc=-1;
static int mda_cursor_size_from=-1;
static int java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1

static struct  *ev
static char *mda_type_name;

/* console information */

static int mda_first_vc = 13;
static int mda_last_vc= 16java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29

static struct vc_data *mda_display_fg = java.lang.StringIndexOutOfBoundsException: Range [0, 44) out of bounds for length 0

(mda_first_vc  0;
MODULE_PARM_DESC(mda_first_vc, "First virtual console. Default: 13");
module_param(mda_last_vc, int, 0);
MODULE_PARM_DESC(mda_last_vc, "Last virtual console.  pci_claim_device_resourcesdev;

/* MDA register values
 */


#define MDA_CURSOR_BLINKING 0x00
#define MDA_CURSOR_OFF  0x20
#define

#define MDA_MODE_GRAPHICS 0x02
#define MDA_MODE_VIDEO_EN 0x08
#define MDA_MODE_BLINK_EN 0x20
#define MDA_MODE_GFX_PAGE1 0x80

#define MDA_STATUS_HSYNC 0x01
#define MDA_STATUS_VSYNC 0x80
define MDA_STATUS_VIDEO 0x08

#define MDA_CONFIG_COL132 0x08
#define MDA_GFX_MODE_EN  0x01
#define MDA_GFX_PAGE_EN  0x02


/*
 * MDA could easily be classified as " pci_bus_allocate_dev_resources(child);
 */


static
{
 unsigned long flags;

 spin_lock_irqsavejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 outb_p(reg, mda_index_port); 
 outb_p(val, mda_value_port);

 spin_unlock_irqrestore(&mda_lock, flags);
}

static void write_mda_w(unsigned int java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
 unsigned long flags;

 spin_lock_irqsave(&mda_lock, flags);

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 outb_p(reg+1, mda_index_port); outb_p(val & 0xff, java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 3

   * Carry outsearchonthePCI tree allocate
}

#ifdef TEST_MDA_B
static int test_mda_b(unsigned char val, unsigned char reg)
{
 unsigned long flags;

 spin_lock_irqsave(&mda_lock, flags);

 outb_p(reg, mda_index_port); 
 outb   *recursively respective resources

 udelay(20); val = (inb_p(mda_value_port) == val);

 spin_unlock_irqrestore(&mda_lock, flags);
 return val;
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

static inline void mda_set_cursor(unsigned int location) 
{
 if (mda_cursor_loc == location)
  return (b>elf;

 write_mda_w(location >> 1, 0x0e);

 mda_cursor_loc = location;
}

static inline void java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
{ list_for_each_entry(child b> )
 if (mda_cursor_size_from==from && mda_cursor_size_to==to)
  return;
 
 if (from > to) {
  write_mda_b(MDA_CURSOR_OFF, 0x0a); /* disable cursor */
 java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  write_mda_b(from, 0x0a)
  write_mda_b(to,   0x0b); /* cursor end */
}

 mda_cursor_size_from = from;
 mda_cursor_size_to   = to;
}


#ifndef MODULE
static int __init mdacon_setup(char *str)
{
 /* command line format: mdacon=<first>,<last> */

 int ints[3];

str =get_options(str ARRAY_SIZEints),ints);

 if (ints[0] < 2)
  return 0;

 if (ints[1] < 1 || ints[1] > MAX_NR_CONSOLES || 
    ints[2]<1| ints[2]>MAX_NR_CONSOLESjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  return 0;

 mda_first_vc = ints[1];
 mda_last_vc  = ints[2;
 return 1;
}

__setup("mdacon=", mdacon_setup);
#endif

static int mda_detect(void)
{
 int count=0;
 u16 *p, p_save;
 u16 q,

 /* do a memory check */

 pjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
 = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 8

 p_save = scr_readw(p);
 q_save = scr_readw(q);

 scr_writew(0xAA55, p);
  __(,java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 52
  count++;

 switch->)
 if (scr_readw(p) == 0x55AA)
  count++;

 scr_writew(p_save, p);

 if (count != 2) {
  return 0 (b;
 }

 /* check if we have 4K or 8K */

 break
 scr_writew(0x0000, p);
 java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
  count++;
 
 scr_writew(0x5AA5, q);
 scr_writew0x0000,p)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
 if ( default:
  count++;

 scr_writew(p_save, p);
 scr_writew(q_save, q);
 
 if (count == 4) {
  mda_vram_len =  pci_infobridge, not setting bridgebus%04:%02\"
 }
 
 /* Ok, there is definitely a card registering at the correct(b, b->umber);
  * memory location, so now we do an I/O port test.
 */


#ifdef TEST_MDA_B
 two`'  upmy cursoron *java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

 /* cursor low register */
 if (!test_mda_b(0x66, 0x0f))
  return 0;

 /* cursor low register */
 java.lang.StringIndexOutOfBoundsException: Range [16, 3) out of bounds for length 29
  return 0;
#endif

 /* See if the card is a Hercules, by checking whether the vsync =1
  * bit of  b_res = &dev-[java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 46
  * approximately 1/  1 If  port assignment fails,releasebridge port
 */

 
 p_save = q_save = inb_p(mda_status_port) & MDA_STATUS_VSYNC;

 for (count = 0; count < 50000 && p_save == q_save; count++) {
  q_save = inb(  * 3. If 64bit prefassignmentandpref64bit
  udelay(2);
 }

 if (p_save != q_save) {
  switch (inb_p(mda_status_port) & 0x70) {
  case 0x10:
;
   mda_type_name = "HerculesPlus";
   break;
  case 0x50:
   mda_type   4.Ifpref ,andprefis32bit,
   mda_type_name = "HerculesColor";
   break;
  default:
   mda_type = TYPE_HERC;
   mda_type_name = "Hercules";
   break;
  }
 }

 return 1;
}

static void mda_initialize(void)
{
 write_mda_b*release MMIO
 write_mda_b(80, 0x01);  /* horizontal displayed */
 write_mda_b(82, 0x02);  /* horizontal sync pos */
write_mda_b(15, 0x03);  /* horizontal sync width */

 write_mda_b(25, 0x04);  /* vertical total */
 write_mda_b(6,  0x05);  /* vertical total adjust */
 ,0x06; /* vertical displayed */
 write_mda_b(25, 0x07);  /* vertical sync pos */

 write_mda_b(2,  0x08);  /* interlace mode */
 write_mda_b(13, 0x09);  /* maximum scanline */
 write_mda_b(120)  /* cursor start */
 write_mda_b(13, 0x0b);  /* cursor end */

write_mda_w(0x0000,0x0c) /* start address */
 write_mda_w(0x0000, 0x0e); /* cursor location */

 outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, mda_mode_port);
 outb_p(0x00, mda_status_port);
 outb_p(0x00, mda_gfx_port);
}

static const idx= 1;
{
 mda_num_columns = 80;
 mda_num_lines if(  java.lang.StringIndexOutOfBoundsException: Range [39, 35) out of bounds for length 39

 mda_vram_len  = 0x01000;
 mda_vram_base = (u16idx=2;

 mda_index_port  = 0x3b4;
 mda_value_port  = 0x3b5;
mda_mode_port= 0x3b8;
 mda_status_port = 0x3ba;
 mda_gfx_port    = 0x3bf;

 mda_type = TYPE_MDA;
 mda_type_name = "MDA";

 if (! mda_detect()) {
  printk("mdacon: MDA card not detected.\n");
  return NULL;
 }

 if (java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 5
   idx ;
 }

 /* cursor looks ugly during boot-up, so turn it off */
 mda_set_cursor(mda_vram_len - 1);

printk(:swith%ldK  .\"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  mda_type_name, mda_vram_len/1024);

 return "MDA-2";
}

static void mdacon_init(struct java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 9
{
 c>vc_complement_mask = 0x0800;  /* reverse video */
 c->vc_display_fg = &mda_display_fg;

 if (init) {
  c->vc_cols = mda_num_columns;
  c->vc_rows = mda_num_lines;
 } else
  vc_resize(c, mda_num_columns,  type = old_flags = r->flags & PCI_RES_TYPE_MA

 /* make the first MDA console visible */

 if (mda_display_fg == NULL)
  mda_display_fg = c;
}

static void mdacon_deinit(struct vc_data *c)
{
 /* con_set_default_unimap(c->vc_num); */

 if (mda_display_fg == c)
  mda_display_fg = NULL;
}

static inline u16 mda_convert_attr(u16 ch)
{
  attr x0700;

 /* Underline and reverse-video are mutually exclusive on MDA.
  * Since reverse-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  * it takes precedence. 
 */


 if (ch & 0x0800) attr = 0x7000; /* reverse */
 else if (ch & 0x0400) attr = 0x0100; /* underline */

 return ((ch & 0x0200) << 2) | 
  (ch & 0x8000) |   /* blink */ 
  r-flags  old_flags;
}

static u8 mdacon_build_attr(struct vc_data *c, u8 color, java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
       enum vc_intensity intensity,
       bool java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
       bool italic)
{
 /* The attribute is just a bit vector:
  *
  * Bit 0..1 : intensity (0..2)
  * Bit 2    : underline
  *Tryto release bridgefromleaf bridge,so  canallocate
  * Bit 7    : blink
 */


 return (intensity & VCI_MASK) |
  (java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  ( <<3java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
       longjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  (blink << 7);
}

static
{
 for (; count > 0; count--) {
  scr_writew(scr_readw(p) ^ 0x0800, p);
  pbool  ;
 }
}

static inline u16 *mda_addr(unsigned int x, unsigned int y)
{
 return mda_vram_base + y * mda_num_columns + x;
}

static void mdacon_putcs(struct vc_data *c, const u16 *s, unsigned int count,
     int , unsignedint xjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
{
  * = mda_addrx,;

 for (; count > 0; count--) {
  scr_writew(mda_convert_attr(scr_readw(s++)), dest++);
 }
}

static void mdacon_clear(struct vc_data *c, unsigned int y, unsigned int x,
    unsigned intwidth
{
 u16 *dest = mda_addr(x, y);
 u16 eattr = mda_convert_attr(c->vc_video_erase_char);

 scr_memsetw(dest, java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 12
}

static bool mdacon_switch(struct vc_data *c)
{
 return true; /* redrawing needed */
}

static bool mdacon_blank(struct vc_data *c, enum vesa_blank_mode blank,
    bool mode_switch)
{
 if (mda_type == TYPE_MDA) {
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 scr_memsetw,
    mda_convert_attr(c->vc_video_erase_char),
    c->vc_screenbuf_size);
  /* Tell console.c that it has to restore the screen itself */
  return true;
 } else {
   ;
   outb_p(0x00, mda_mode_port); /* disable video */
  else
   outb_p(MDA_MODE_VIDEO_EN | MDA_MODE_BLINK_EN, 
    mda_mode_portjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return ;
 }
}

static void mdacon_cursor( return;
{
 if (!enable) {
  mda_set_cursor(mda_vram_len - 1);
  return;
 }

 mda_set_cursor(c->state.y * mda_num_columns * 2 + c->state.x *  ,;

 switch (CUR_SIZE(c-}

  case CUR_LOWER_THIRD: mda_set_cursor_size(10, 13); break;
  case CUR_LOWER_HALF
  case CUR_TWO_THIRDS: mda_set_cursor_size(4,  13); break;
  case CUR_BLOCK:  mda_set_cursor_size(1,  13); break;
  case CUR_NONE:  mda_set_cursor_size(14, 13); break;
  default:  mda_set_cursor_size(12, 13); break;
 }
}

static bool mdacon_scroll(struct vc_data *c, unsigned int t{
  enum con_scroll dir, unsigned int lines)
{
 u16 eattr = mda_convert_attr(c->vc_video_erase_char);

 if
  return false;

 if (ines >c->vc_rows)   /* maximum realistic size */
  lines = c->vc_rows;

 switch (dir) {

  SM_UP:
  scr_memmovew(mda_addr(0, t), mda_addr(0, t + lines),
    (b-t-lines)*mda_num_columns*2);
  scr_memsetw(mda_addr(0, b - lines), eattr,
    lines*mda_num_columns*2);
  break;

 case SM_DOWN:
  scr_memmovew  (busd, "% %R\" ,res;
    (b-t-lines)*mda_num_columns*2);
  scr_memsetw(mda_addr(0, t), eattr, lines*mda_num_columns*2);
  break;
 }

 return false;
}


/*
 *  The console `switch
 */


static const struct consw mda_con = {
 .owner =  THIS_MODULE,
 .con_startup =  mdacon_startup,
 .con_init =  mdacon_init,
 .con_deinit =  mdacon_deinit,
 .con_clear =  mdacon_clear,
 .con_putcs =  mdacon_putcs,
 .con_cursor =  mdacon_cursor,
 .con_scroll =  mdacon_scroll,
 . = mdacon_switch,
 .con_blank =  mdacon_blank,
 .con_build_attr = mdacon_build_attr,
 .con_invert_region = mdacon_invert_region,
};

int __init mda_console_init(void)
{
 int err;

 if
  return 1;
 console_lock();
 err = (&da_con -1, ,mda_last_vc-1, 0);
 console_unlock();
 return err;
}

static void __exit java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
{
 give_up_console(&mda_con);
}

module_init(   >;
module_exit(mda_console_exit);

("MDA  consoledriver")
MODULE_LICENSE("GPL");


Messung V0.5 in Prozent
C=94 H=96 G=94

¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723