~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/kdrive/vga.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Id: vga.h,v 1.1 1999/11/02 03:54:46 keithp Exp $
 
3
 *
 
4
 * Copyright � 1999 Keith Packard
 
5
 *
 
6
 * Permission to use, copy, modify, distribute, and sell this software and its
 
7
 * documentation for any purpose is hereby granted without fee, provided that
 
8
 * the above copyright notice appear in all copies and that both that
 
9
 * copyright notice and this permission notice appear in supporting
 
10
 * documentation, and that the name of Keith Packard not be used in
 
11
 * advertising or publicity pertaining to distribution of the software without
 
12
 * specific, written prior permission.  Keith Packard makes no
 
13
 * representations about the suitability of this software for any purpose.  It
 
14
 * is provided "as is" without express or implied warranty.
 
15
 *
 
16
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 
17
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
 
18
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 
19
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
 
20
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
 
21
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 
22
 * PERFORMANCE OF THIS SOFTWARE.
 
23
 */
 
24
/* $XFree86: xc/programs/Xserver/hw/kdrive/vga.h,v 1.4 2000/05/24 23:57:56 keithp Exp $ */
 
25
 
 
26
#ifndef _VGA_H_
 
27
#define _VGA_H_
 
28
 
 
29
typedef unsigned long   VGA32;
 
30
typedef unsigned short  VGA16;
 
31
typedef unsigned char   VGA8;
 
32
typedef int             VGABOOL;
 
33
typedef volatile VGA8   VGAVOL8;
 
34
 
 
35
#define VGATRUE     1
 
36
#define VGAFALSE    0
 
37
 
 
38
typedef struct _vgaReg {
 
39
    VGA16       id;
 
40
    VGA8        base;
 
41
    VGA8        len;
 
42
} VgaReg;
 
43
 
 
44
#define VGA_REG_NONE        0xffff
 
45
#define VGA_REG_END         VGA_REG_NONE, 0, 0
 
46
 
 
47
typedef struct _vgaValue {
 
48
    VGA8        save;
 
49
    VGA8        cur;
 
50
    VGA16       flags;
 
51
} VgaValue;
 
52
 
 
53
#define VGA_VALUE_VALID     1   /* value ever fetched */
 
54
#define VGA_VALUE_MODIFIED  2   /* value ever changed */
 
55
#define VGA_VALUE_DIRTY     4   /* value needs syncing */
 
56
#define VGA_VALUE_SAVED     8   /* value preserved */
 
57
 
 
58
typedef enum _vgaAccess {
 
59
    VgaAccessMem, VgaAccessIo, VgaAccessIndMem, VgaAccessIndIo,
 
60
    VgaAccessDone
 
61
} VgaAccess;
 
62
 
 
63
typedef struct _vgaMap {
 
64
    VgaAccess   access;
 
65
    VGA32       port;
 
66
    VGA8        addr;       /* for Ind access; addr offset from port */
 
67
    VGA8        value;      /* for Ind access; value offset from port */
 
68
    VGA8        index;      /* for Ind access; index value */
 
69
} VgaMap;
 
70
 
 
71
#define VGA_UNLOCK_FIXED    1   /* dont save current value */
 
72
#define VGA_UNLOCK_LOCK     2   /* execute only on relock */
 
73
#define VGA_UNLOCK_UNLOCK   4   /* execute only on unlock */
 
74
 
 
75
typedef struct _vgaSave {
 
76
    VGA16       first;
 
77
    VGA16       last;
 
78
} VgaSave;
 
79
 
 
80
#define VGA_SAVE_END    VGA_REG_NONE, VGA_REG_NONE
 
81
 
 
82
typedef struct _vgaCard {
 
83
    void        (*map) (struct _vgaCard *card, VGA16 reg, VgaMap *map, VGABOOL write);
 
84
    void        *closure;
 
85
    int         max;
 
86
    VgaValue    *values;
 
87
    VgaSave     *saves;
 
88
} VgaCard;
 
89
 
 
90
VGA8
 
91
VgaInb (VGA16 r);
 
92
 
 
93
void
 
94
VgaOutb (VGA8 v, VGA16 r);
 
95
    
 
96
VGA8
 
97
VgaReadMemb (VGA32 addr);
 
98
 
 
99
void
 
100
VgaWriteMemb (VGA8 v, VGA32 addr);
 
101
 
 
102
void
 
103
VgaSetImm (VgaCard *card, VgaReg *reg, VGA32 value);
 
104
 
 
105
VGA32
 
106
VgaGetImm (VgaCard *card, VgaReg *reg);
 
107
 
 
108
void
 
109
VgaSet (VgaCard *card, VgaReg *reg, VGA32 value);
 
110
 
 
111
VGA32
 
112
VgaGet (VgaCard *card, VgaReg *reg);
 
113
 
 
114
void
 
115
VgaFlush (VgaCard *card);
 
116
 
 
117
void
 
118
VgaFill (VgaCard *card, VGA16 low, VGA16 high);
 
119
 
 
120
void
 
121
VgaPreserve (VgaCard *card);
 
122
 
 
123
void
 
124
VgaInvalidate (VgaCard *card);
 
125
 
 
126
void
 
127
VgaRestore (VgaCard *card);
 
128
 
 
129
VGA8
 
130
VgaFetch (VgaCard *card, VGA16 id);
 
131
 
 
132
void
 
133
VgaStore (VgaCard *card, VGA16 id, VGA8 value);
 
134
 
 
135
VGA8
 
136
_VgaFetchInd (VGA16 port, VGA8 reg);
 
137
 
 
138
void
 
139
_VgaStoreInd (VGA16 port, VGA8 reg, VGA8 value);
 
140
 
 
141
#endif /* _VGA_H_ */