1
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.h,v 1.23 2003/08/24 17:36:50 dawes Exp $ */
4
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
6
* Permission is hereby granted, free of charge, to any person obtaining a
7
* copy of this software and associated documentation files (the "Software"),
8
* to deal in the Software without restriction, including without limitation
9
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
* and/or sell copies of the Software, and to permit persons to whom the
11
* Software is furnished to do so, subject to the following conditions:
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
* OTHER DEALINGS IN THE SOFTWARE.
24
* Except as contained in this notice, the name of the copyright holder(s)
25
* and author(s) shall not be used in advertising or otherwise to promote
26
* the sale, use or other dealings in this Software without prior written
27
* authorization from the copyright holder(s) and author(s).
31
* This file contains definitions of the bus-related data structures/types.
32
* Everything contained here is private to xf86Bus.c. In particular the
33
* video drivers must not include this file.
36
#ifdef HAVE_XORG_CONFIG_H
37
#include <xorg-config.h>
43
#include "xf86pciBus.h"
45
#include "xf86sbusBus.h"
48
typedef struct racInfo {
49
xf86AccessPtr mem_new;
51
xf86AccessPtr io_mem_new;
52
xf86SetAccessFuncPtr old;
53
} AccessFuncRec, *AccessFuncPtr;
60
EntityProc entityInit;
61
EntityProc entityEnter;
62
EntityProc entityLeave;
68
EntityAccessPtr access;
72
DevUnion * entityPrivates;
76
} EntityRec, *EntityPtr;
78
/* asynchronous event handling */
80
typedef struct _AsyncQRec {
81
void (*func)(pointer);
83
struct _AsyncQRec *next;
84
} AsyncQRec, *AsyncQPtr;
87
#define NO_SEPARATE_IO_FROM_MEM 0x0001
88
#define NO_SEPARATE_MEM_FROM_IO 0x0002
89
#define NEED_VGA_ROUTED 0x0004
90
#define NEED_VGA_ROUTED_SETUP 0x0008
91
#define NEED_MEM 0x0010
92
#define NEED_IO 0x0020
93
#define NEED_MEM_SHARED 0x0040
94
#define NEED_IO_SHARED 0x0080
95
#define ACCEL_IS_SHARABLE 0x0100
96
#define IS_SHARED_ACCEL 0x0200
97
#define SA_PRIM_INIT_DONE 0x0400
98
#define NEED_VGA_MEM 0x1000
99
#define NEED_VGA_IO 0x2000
101
#define NEED_SHARED (NEED_MEM_SHARED | NEED_IO_SHARED)
103
#define busType bus.type
104
#define pciBusId bus.id.pci
105
#define isaBusId bus.id.isa
106
#define sbusBusId bus.id.sbus
109
typedef void (*BusAccProcPtr)(struct x_BusAccRec *ptr);
111
typedef struct x_BusAccRec {
113
BusAccProcPtr enable_f;
114
BusAccProcPtr disable_f;
115
BusAccProcPtr save_f;
116
BusAccProcPtr restore_f;
117
struct x_BusAccRec *current; /* pointer to bridge open on this bus */
118
struct x_BusAccRec *primary; /* pointer to the bus connecting to this */
119
struct x_BusAccRec *next; /* this links the different buses together */
122
/* Bus-specific fields */
131
} BusAccRec, *BusAccPtr;
133
/* state change notification callback */
134
typedef struct _stateChange {
135
xf86StateChangeNotificationCallbackFunc func;
137
struct _stateChange *next;
138
} StateChangeNotificationRec, *StateChangeNotificationPtr;
141
extern EntityPtr *xf86Entities;
142
extern int xf86NumEntities;
143
extern xf86AccessRec AccessNULL;
144
extern BusRec primaryBus;
147
extern resPtr ResRange;
148
extern BusAccPtr xf86BusAccInfo;
150
int xf86AllocateEntity(void);
151
BusType StringToBusType(const char* busID, const char **retID);
152
memType ChkConflict(resRange *rgp, resPtr res, xf86State state);
153
Bool xf86IsSubsetOf(resRange range, resPtr list);
154
Bool xf86IsListSubsetOf(resPtr list, resPtr BaseList);
155
resPtr xf86ExtractTypeFromList(resPtr list, unsigned long type);
156
resPtr findIntersect(resRange Range, resPtr list);
157
resPtr xf86FindIntersect(resRange Range, resPtr list);
158
void RemoveOverlaps(resPtr target, resPtr list, Bool pow2Alignment,
160
void xf86ConvertListToHost(int entityIndex, resPtr list);
162
#endif /* _XF86_BUS_H */