Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1029 serge 1
 
2
#define AGP_APBASE	0x10
3
4
 
5
#define AGPCMD		0x8
6
#define AGPNISTAT	0xc
7
#define AGPCTRL		0x10
8
#define AGPAPSIZE	0x14
9
#define AGPNEPG		0x16
10
#define AGPGARTLO	0x18
11
#define AGPGARTHI	0x1c
12
#define AGPNICMD	0x20
13
14
 
15
 
16
#define AGP_MINOR_VERSION_SHIFT	(16)
17
18
 
19
#define AGPSTAT_RQ_DEPTH_SHIFT	24
20
21
 
22
#define AGPSTAT_ARQSZ		(1<<15|1<<14|1<<13)
23
#define AGPSTAT_ARQSZ_SHIFT	13
24
25
 
26
#define AGPSTAT_AGP_ENABLE	(1<<8)
27
#define AGPSTAT_FW          (1<<4)
28
#define AGPSTAT_MODE_3_0	(1<<3)
29
30
 
31
#define AGPSTAT2_2X         (1<<1)
32
#define AGPSTAT2_4X         (1<<2)
33
34
 
35
#define AGPSTAT3_8X         (1<<1)
36
#define AGPSTAT3_4X         (1)
37
38
 
39
#define AGPCTRL_GTLBEN		(1<<7)
40
41
 
42
#define AGP3_RESERVED_MASK 0x00ff00c4
43
44
 
45
#define AGP_ERRATA_SBA	 1<<1
46
#define AGP_ERRATA_1X 1<<2
47
48
 
49
 
50
 
51
#define INTEL_APSIZE        0xb4
52
#define INTEL_ATTBASE       0xb8
53
#define INTEL_AGPCTRL       0xb0
54
#define INTEL_NBXCFG        0x50
55
#define INTEL_ERRSTS        0x91
56
57
 
58
#define INTEL_I845_AGPM		0x51
59
#define INTEL_I845_ERRSTS	0xc8
60
61
 
62
#define AGP_APBASE	0x10
63
64
 
65
{
66
    size_t    size;
67
    count_t   num_entries;
68
    count_t   pages_count;
69
    u32_t     size_value;
70
}aper_size_t;
71
72
 
73
{
74
    PCITAG    PciTag;
75
76
 
77
    aper_size_t    *current_size;
78
    aper_size_t    *previous_size;
79
    int             aperture_size_idx;
80
81
 
82
    addr_t          gatt_dma;
83
84
 
85
    addr_t          gart_addr;
86
87
 
88
    u32_t           mode;
89
90
 
91
92
 
93
    char            minor_version;
94
95
 
96
//   enum    aper_size_type size_type;
97
//    int     cant_use_aperture;
98
//    int     needs_scratch_page;
99
//    struct gatt_mask *masks;
100
    int     (*fetch_size)();
101
    int     (*configure)();
102
//    void    (*agp_enable)(struct agp_bridge_data *, u32);
103
//    void    (*cleanup)(void);
104
    void    (*tlb_flush)();
105
//    u32_t   (*mask_memory)(struct agp_bridge_data *,u32_t, int);
106
//    void    (*cache_flush)(void);
107
    int     (*create_gatt_table)();
108
//    int     (*free_gatt_table)(struct agp_bridge_data *);
109
//    int     (*insert_memory)(struct agp_memory *, off_t, int);
110
//    int     (*remove_memory)(struct agp_memory *, off_t, int);
111
//    struct  agp_memory *(*alloc_by_type) (size_t, int);
112
//    void    (*free_by_type)(struct agp_memory *);
113
//    void   *(*agp_alloc_page)(struct agp_bridge_data *);
114
//    void    (*agp_destroy_page)(void *);
115
}agp_t;
116
117
 
118
 * min()/max() macros that also do
119
 * strict type-checking.. See the
120
 * "unnecessary" pointer comparison.
121
 */
122
#define min(x,y) ({ \
123
	typeof(x) _x = (x);	\
124
	typeof(y) _y = (y);	\
125
	(void) (&_x == &_y);		\
126
	_x < _y ? _x : _y; })
127
128
 
129
	typeof(x) _x = (x);	\
130
	typeof(y) _y = (y);	\
131
	(void) (&_x == &_y);		\
132
	_x > _y ? _x : _y; })
133
134
 
135
 
136
	({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
137
#define max_t(type,x,y) \
138
	({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
139
140
 
141
142
 
143
144
 
145
 
146
 
147