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 int scrw2glyph(unsigned short scr_word);
  23 extern void complement_pos(int currcons, int offset);
  24 extern void invert_screen(int currcons, int offset, int count, int shift);
  25 
  26 #define reverse_video_char(a)   (((a) & 0x88) | ((((a) >> 4) | ((a) << 4)) & 0x77))
  27 #define reverse_video_short(a)  (((a) & 0x88ff) | \
  28         (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4))
  29 /* this latter line used to have masks 0xf000 and 0x0f00, but selection
  30    requires a self-inverse operation; moreover, the old version looks wrong */
  31 
  32 extern void getconsxy(int currcons, char *p);
  33 extern void putconsxy(int currcons, char *p);
  34 
  35 /* how to access screen memory */
  36 #ifdef __alpha__
  37 
  38 #include <asm/io.h> 
  39 
  40 static inline void scr_writeb(unsigned char val, unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  41 {
  42         if ((long) addr < 0)
  43                 *addr = val;
  44         else
  45                 writeb(val, (unsigned long) addr);
  46 }
  47 
  48 static inline unsigned char scr_readb(unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  49 {
  50         if ((long) addr < 0)
  51                 return *addr;
  52         return readb((unsigned long) addr);
  53 }
  54 
  55 static inline void scr_writew(unsigned short val, unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  56 {
  57         if ((long) addr < 0)
  58                 *addr = val;
  59         else
  60                 writew(val, (unsigned long) addr);
  61 }
  62 
  63 static inline unsigned short scr_readw(unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  64 {
  65         if ((long) addr < 0)
  66                 return *addr;
  67         return readw((unsigned long) addr);
  68 }
  69 
  70 #else
  71 
  72 static inline void scr_writeb(unsigned char val, unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  73 {
  74         *addr = val;
  75 }
  76 
  77 static inline unsigned char scr_readb(unsigned char * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  78 {
  79         return *addr;
  80 }
  81 
  82 static inline void scr_writew(unsigned short val, unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  83 {
  84         *addr = val;
  85 }
  86 
  87 static inline unsigned short scr_readw(unsigned short * addr)
     /* [previous][next][first][last][top][bottom][index][help] */
  88 {
  89         return *addr;
  90 }
  91 
  92 #endif

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