~ubuntu-branches/ubuntu/karmic/virtualbox-ose/karmic-updates

« back to all changes in this revision

Viewing changes to src/VBox/Additions/x11/x11include/4.2/programs/Xserver/hw/xfree86/os-support/bus/Pci.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-09-14 18:25:07 UTC
  • mfrom: (0.4.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090914182507-c98g07mq16hjmn6d
Tags: 3.0.6-dfsg-1ubuntu1
* Merge from debian unstable (LP: #429697), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
  - virtualbox, virtualbox-* (names of the upstream proprietary packages)
    conflict with virtualbox-ose (LP: #379878)
* Make debug package depend on normal or guest utils package
* Drop patches/22-pulseaudio-stubs.dpatch (applied upstream)
* Rename Ubuntu specific patches to uXX-*.dpatch
* Fix lintian warnings in maintainer scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.21 2001/11/01 23:35:33 dawes Exp $ */
2
 
/*
3
 
 * Copyright 1998 by Concurrent Computer Corporation
4
 
 *
5
 
 * Permission to use, copy, modify, distribute, and sell this software
6
 
 * and its documentation for any purpose is hereby granted without fee,
7
 
 * provided that the above copyright notice appear in all copies and that
8
 
 * both that copyright notice and this permission notice appear in
9
 
 * supporting documentation, and that the name of Concurrent Computer
10
 
 * Corporation not be used in advertising or publicity pertaining to
11
 
 * distribution of the software without specific, written prior
12
 
 * permission.  Concurrent Computer Corporation makes no representations
13
 
 * about the suitability of this software for any purpose.  It is
14
 
 * provided "as is" without express or implied warranty.
15
 
 *
16
 
 * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
17
 
 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
18
 
 * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
19
 
 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
20
 
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
21
 
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
22
 
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
23
 
 * SOFTWARE.
24
 
 *
25
 
 * Copyright 1998 by Metro Link Incorporated
26
 
 *
27
 
 * Permission to use, copy, modify, distribute, and sell this software
28
 
 * and its documentation for any purpose is hereby granted without fee,
29
 
 * provided that the above copyright notice appear in all copies and that
30
 
 * both that copyright notice and this permission notice appear in
31
 
 * supporting documentation, and that the name of Metro Link
32
 
 * Incorporated not be used in advertising or publicity pertaining to
33
 
 * distribution of the software without specific, written prior
34
 
 * permission.  Metro Link Incorporated makes no representations
35
 
 * about the suitability of this software for any purpose.  It is
36
 
 * provided "as is" without express or implied warranty.
37
 
 *
38
 
 * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
39
 
 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40
 
 * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
41
 
 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
42
 
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43
 
 * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44
 
 * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
45
 
 * SOFTWARE.
46
 
 *
47
 
 * This file is derived in part from the original xf86_PCI.h that included
48
 
 * following copyright message:
49
 
 *
50
 
 * Copyright 1995 by Robin Cutshaw <robin@XFree86.Org>
51
 
 *
52
 
 * Permission to use, copy, modify, distribute, and sell this software and its
53
 
 * documentation for any purpose is hereby granted without fee, provided that
54
 
 * the above copyright notice appear in all copies and that both that
55
 
 * copyright notice and this permission notice appear in supporting
56
 
 * documentation, and that the names of the above listed copyright holder(s)
57
 
 * not be used in advertising or publicity pertaining to distribution of 
58
 
 * the software without specific, written prior permission.  The above listed
59
 
 * copyright holder(s) make(s) no representations about the suitability of this 
60
 
 * software for any purpose.  It is provided "as is" without express or 
61
 
 * implied warranty.
62
 
 *
63
 
 * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD 
64
 
 * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
65
 
 * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE 
66
 
 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
67
 
 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER 
68
 
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 
69
 
 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
70
 
 *
71
 
 */
72
 
 
73
 
/*
74
 
 * This file has the private Pci definitions.  The public ones are imported
75
 
 * from xf86Pci.h.  Drivers should not use this file.
76
 
 */
77
 
#ifndef _PCI_H
78
 
#define _PCI_H 1
79
 
#include "Xarch.h"
80
 
#include "Xfuncproto.h"
81
 
#include "xf86Pci.h"
82
 
 
83
 
/*
84
 
 * Global Definitions
85
 
 */
86
 
#define MAX_PCI_DEVICES 64      /* Max number of devices accomodated */
87
 
                                /* by xf86scanpci                    */
88
 
#if defined(i386) || defined(__i386__) || defined(__i386)
89
 
/* Q&D stopgap to deal with mainboards whose PCI space is smaller */
90
 
#define MAX_PCI_BUSES   128     /* Max number of PCI buses           */
91
 
#else
92
 
#define MAX_PCI_BUSES   256     /* Max number of PCI buses           */
93
 
#endif
94
 
 
95
 
#define PCI_NOT_FOUND   0xffffffff
96
 
 
97
 
/*
98
 
 *   
99
 
 */
100
 
#define PCI_MAKE_TAG(b,d,f)  ((((b) & 0xff) << 16) | \
101
 
                              (((d) & 0x1f) << 11) | \
102
 
                              (((f) & 0x7) << 8))
103
 
 
104
 
#define PCI_BUS_FROM_TAG(tag)  (((tag) & 0x00ff0000) >> 16)
105
 
#define PCI_DEV_FROM_TAG(tag)  (((tag) & 0x0000f800) >> 11)
106
 
#define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700) >> 8)
107
 
 
108
 
#define PCI_DFN_FROM_TAG(tag) (((tag) & 0x0000ff00) >> 8)
109
 
 
110
 
/*
111
 
 * Debug Macros/Definitions
112
 
 */
113
 
/* #define DEBUGPCI  2 */    /* Disable/enable trace in PCI code */
114
 
 
115
 
#if defined(DEBUGPCI)
116
 
 
117
 
# define PCITRACE(lvl,printfargs) \
118
 
        if (lvl > xf86Verbose) { \
119
 
                ErrorF printfargs; \
120
 
        }
121
 
 
122
 
#else /* !defined(DEBUGPCI) */
123
 
 
124
 
# define PCITRACE(lvl,printfargs)
125
 
 
126
 
#endif /* !defined(DEBUGPCI) */
127
 
 
128
 
/*
129
 
 * PCI Config mechanism definitions
130
 
 */
131
 
#define PCI_EN 0x80000000
132
 
 
133
 
#define PCI_CFGMECH1_ADDRESS_REG        0xCF8
134
 
#define PCI_CFGMECH1_DATA_REG           0xCFC
135
 
 
136
 
#define PCI_CFGMECH1_MAXDEV     32
137
 
 
138
 
#define PCI_CFGMECH1_TYPE1_CFGADDR(b,d,f,o) (PCI_EN | PCI_MAKE_TAG(b,d,f) | ((o) & 0xff) | 1)
139
 
#define PCI_CFGMECH1_TYPE0_CFGADDR(d,f,o) (PCI_EN | PCI_MAKE_TAG(0,d,f) | ((o) & 0xff))
140
 
 
141
 
/*
142
 
 * Select architecture specific PCI init function
143
 
 */
144
 
#if (defined(__powerpc__) || defined(__mips__) || defined(__sh__) || defined(__mc68000__) || defined(__arm__) || defined(__s390__) || defined(__hppa__)) && defined(linux)
145
 
# define ARCH_PCI_INIT linuxPciInit
146
 
# define INCLUDE_XF86_MAP_PCI_MEM
147
 
#elif defined(__powerpc__) && defined(__OpenBSD__)
148
 
# define  ARCH_PCI_INIT freebsdPciInit
149
 
# define INCLUDE_XF86_MAP_PCI_MEM
150
 
#elif defined(__powerpc__)
151
 
# define ARCH_PCI_INIT ppcPciInit
152
 
# if !defined(PowerMAX_OS)
153
 
#  define INCLUDE_XF86_MAP_PCI_MEM
154
 
# endif
155
 
#elif defined(__sparc__) && (defined(linux) || defined(sun))
156
 
# define ARCH_PCI_INIT sparcPciInit
157
 
# define INCLUDE_XF86_MAP_PCI_MEM
158
 
#elif defined(__alpha__) && defined(linux)
159
 
# define ARCH_PCI_INIT axpPciInit
160
 
# define INCLUDE_XF86_MAP_PCI_MEM
161
 
#elif defined(__i386__) && defined(linux)
162
 
# define ARCH_PCI_INIT ix86PciInit
163
 
# define ARCH_PCI_OS_INIT linuxPciInit
164
 
# define INCLUDE_XF86_MAP_PCI_MEM
165
 
#elif defined(__ia64__) && defined(linux)
166
 
# define ARCH_PCI_INIT linuxPciInit
167
 
# define INCLUDE_XF86_MAP_PCI_MEM
168
 
#elif defined(__alpha__) && defined(__FreeBSD__)
169
 
# define ARCH_PCI_INIT freebsdPciInit
170
 
# define INCLUDE_XF86_MAP_PCI_MEM
171
 
#else
172
 
# define ARCH_PCI_INIT ix86PciInit
173
 
# define INCLUDE_XF86_MAP_PCI_MEM
174
 
#endif
175
 
extern void ARCH_PCI_INIT(void);
176
 
#if defined(ARCH_PCI_OS_INIT)
177
 
extern void ARCH_PCI_OS_INIT(void);
178
 
#endif
179
 
 
180
 
/*
181
 
 * Table of functions used to access a specific PCI bus domain
182
 
 * (e.g. a primary PCI bus and all of its secondaries)
183
 
 */
184
 
typedef struct pci_bus_funcs {
185
 
        CARD32  (*pciReadLong)(PCITAG, int);
186
 
        void    (*pciWriteLong)(PCITAG, int, CARD32);
187
 
        void    (*pciSetBitsLong)(PCITAG, int, CARD32, CARD32);
188
 
        ADDRESS (*pciAddrHostToBus)(PCITAG, PciAddrType, ADDRESS);
189
 
        ADDRESS (*pciAddrBusToHost)(PCITAG, PciAddrType, ADDRESS);
190
 
} pciBusFuncs_t;
191
 
 
192
 
/*
193
 
 * pciBusInfo_t - One structure per defined PCI bus 
194
 
 */
195
 
typedef struct pci_bus_info {
196
 
        unsigned char  configMech;   /* PCI config type to use      */
197
 
        unsigned char  numDevices;   /* Range of valid devnums      */
198
 
        unsigned char  secondary;    /* Boolean: bus is a secondary */
199
 
        unsigned char  primary_bus;  /* Top level (primary) parent  */
200
 
        unsigned long  ppc_io_base;  /* PowerPC I/O spc membase     */
201
 
        unsigned long  ppc_io_size;  /* PowerPC I/O spc size        */
202
 
        pciBusFuncs_t  funcs;        /* PCI access functions        */
203
 
        void          *pciBusPriv;   /* Implementation private data */
204
 
} pciBusInfo_t;
205
 
 
206
 
/* configMech values */
207
 
#define PCI_CFG_MECH_UNKNOWN 0 /* Not yet known  */
208
 
#define PCI_CFG_MECH_1       1 /* Most machines  */
209
 
#define PCI_CFG_MECH_2       2 /* Older PC's     */
210
 
#define PCI_CFG_MECH_OTHER   3 /* Something else */
211
 
 
212
 
/* Generic PCI service functions and helpers */
213
 
PCITAG        pciGenFindFirst(void);
214
 
PCITAG        pciGenFindNext(void);
215
 
CARD32        pciCfgMech1Read(PCITAG tag, int offset);
216
 
void          pciCfgMech1Write(PCITAG tag, int offset, CARD32 val);
217
 
void          pciCfgMech1SetBits(PCITAG tag, int offset, CARD32 mask,
218
 
                                 CARD32 val);
219
 
CARD32        pciByteSwap(CARD32);
220
 
Bool          pciMfDev(int, int);
221
 
CARD32        pciReadLongNULL(PCITAG tag, int offset);
222
 
void          pciWriteLongNULL(PCITAG tag, int offset, CARD32 val);
223
 
void          pciSetBitsLongNULL(PCITAG tag, int offset, CARD32 mask,
224
 
                                 CARD32 val);
225
 
ADDRESS       pciAddrNOOP(PCITAG tag, PciAddrType type, ADDRESS);
226
 
 
227
 
extern PCITAG (*pciFindFirstFP)(void);
228
 
extern PCITAG (*pciFindNextFP)(void);
229
 
 
230
 
extern CARD32 pciDevid;    
231
 
extern CARD32 pciDevidMask;
232
 
 
233
 
extern int    pciBusNum;
234
 
extern int    pciDevNum;
235
 
extern int    pciFuncNum;
236
 
extern PCITAG pciDeviceTag;
237
 
 
238
 
extern pciBusInfo_t  *pciBusInfo[];
239
 
 
240
 
extern pciBusFuncs_t pciNOOPFuncs;
241
 
 
242
 
#endif /* _PCI_H */