root/drivers/char/selection.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. scr_writeb
  2. scr_readb
  3. scr_writew
  4. scr_readw
  5. scr_writeb
  6. scr_readb
  7. scr_writew
  8. scr_readw

   1 /*
   2  * selection.h
   3  *
   4  * Interface between console.c, tty_io.c, vt.c, vc_screen.c and selection.c
   5  */
   6 extern int sel_cons;
   7 
   8 extern void clear_selection(void);
   9 extern int set_selection(const unsigned long arg, struct tty_struct *tty);
  10 extern int paste_selection(struct tty_struct *tty);
  11 extern int sel_loadlut(const unsigned long arg);
  12 extern int mouse_reporting(void);
  13 extern void mouse_report(struct tty_struct * tty, int butt, int mrx, int mry);
  14 
  15 extern unsigned long video_num_columns;
  16 extern unsigned long video_num_lines;
  17 extern unsigned long video_size_row;
  18 
  19 extern void do_unblank_screen(void);
  20 extern unsigned short *screen_pos(int currcons, int w_offset, int viewed);
  21 extern unsigned short screen_word(int currcons, int offset, int viewed);
  22 extern void complement_pos(int currcons, int offset);
  23 extern void invert_screen(int currcons, int offset, int count, int shift);
  24 
  25 #define reverse_video_char(a)   (((a) & 0x88) | ((((a) >> 4) | ((a) << 4)) & 0x77))
  26 #define reverse_video_short(a)  (((a) & 0x88ff) | \
  27         (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4))
  28 /* this latter line used to have masks 0xf000 and 0x0f00, but selection
  29    requires a self-inverse operation; moreover, the old version looks wrong */
  30 
  31 extern void getconsxy(int currcons, char *p);
  32 extern void putconsxy(int currcons, char *p);
  33 
  34 /* how to access screen memory */
  35 #ifdef __alpha__
  36 
  37 #include <asm/io.h> 
  38 
  39 static inline void scr_writeb(unsigned char val, unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  40 {
  41         if ((long) addr < 0)
  42                 *addr = val;
  43         else
  44                 writeb(val, (unsigned long) addr);
  45 }
  46 
  47 static inline unsigned char scr_readb(unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  48 {
  49         if ((long) addr < 0)
  50                 return *addr;
  51         return readb((unsigned long) addr);
  52 }
  53 
  54 static inline void scr_writew(unsigned short val, unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  55 {
  56         if ((long) addr < 0)
  57                 *addr = val;
  58         else
  59                 writew(val, (unsigned long) addr);
  60 }
  61 
  62 static inline unsigned short scr_readw(unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  63 {
  64         if ((long) addr < 0)
  65                 return *addr;
  66         return readw((unsigned long) addr);
  67 }
  68 
  69 #else
  70 
  71 static inline void scr_writeb(unsigned char val, unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  72 {
  73         *addr = val;
  74 }
  75 
  76 static inline unsigned char scr_readb(unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  77 {
  78         return *addr;
  79 }
  80 
  81 static inline void scr_writew(unsigned short val, unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  82 {
  83         *addr = val;
  84 }
  85 
  86 static inline unsigned short scr_readw(unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  87 {
  88         return *addr;
  89 }
  90 
  91 #endif

/* [previous][next][first][last][top][bottom][index][help] */