summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halraw/alpha/rwintbal.h
blob: ba3d5fb0ab100650c1aca8deb4b1cae45211a168 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
/*++

Copyright (c) 1995  Digital Equipment Corporation

Module Name:

    rwintbal.h

Abstract:

    This file contains definitions specific to the Rawhide platform

Author:

    Matthew Buchman    29-Nov-1995

Environment:

    Kernel mode

Revision History:


--*/

#ifndef _RWINTBALH_
#define _RWINTBALH_

#if !defined (_LANGUAGE_ASSEMBLY)

//
// Define the structures for assigning vector affinity
//

//
// Generic weighted list.  The weight field is used by the
// affinity assignment algorithm when selecting IOD and CPU's
//

typedef struct _WEIGHTED_LIST_ENTRY {
    LIST_ENTRY ListEntry;
    LONG Weight;
} WEIGHTED_LIST_ENTRY, *PWEIGHTED_LIST_ENTRY;

//
// Search Criteria enum for MAX/MIN search
//

typedef enum _WEIGHTED_SEARCH_CRITERIA {
    FindMaxWeight,
    FindMinWeight
} WEIGHTED_SEARCH_CRITERIA, *PWEIGHTED_SEARC_CRITERIA;

//
// Define CPU vector information structure.
//

typedef struct _CPU_VECTOR_DATA {

    WEIGHTED_LIST_ENTRY ListEntry;          // Generic list
    ULONG LogicalNumber;                    // Logical Id for this CPU

} CPU_VECTOR_DATA, *PCPU_VECTOR_DATA;

//
// Define IOD vector data structure.  This structure
// contains information on devices present on an IOD, their
// vectors, and shadow registers for IntReq and IntTarg
//

typedef struct _IOD_VECTOR_DATA {

    WEIGHTED_LIST_ENTRY ListEntry;          // Generic list

    PCPU_VECTOR_DATA TargetCpu[2];          // Target CPU vector data

    RTL_BITMAP VectorPresent[2];            // IOD device vectors present
    RTL_BITMAP SharedVector[2];             // IOD device vectors shared
    ULONG VectorPresentBits[2];             // bitmap storage
    ULONG SharedVectorBits[2];              // bitmap storage
    ULONG BusNumber;                        // Logical bus number for this IOD
    ULONG HwBusNumber;                      // Physical bus number for this IOD
    ULONG Affinity[2];                      // Vector AFFINITY for targets 0/1
    IOD_INT_MASK IntMask[2];                // Shadow of IOD IntMaskX
    MC_DEVICE_ID IntTarg[2];                // Shadow of IOD IntTargX

} IOD_VECTOR_DATA, *PIOD_VECTOR_DATA;


typedef enum _IOD_IRR_BITS{

    IodPci0IrrBit      = 0,
    IodPci1IrrBit      = 1,
    IodPci2IrrBit      = 2,
    IodPci3IrrBit      = 3,
    IodPci4IrrBit      = 4,
    IodPci5IrrBit      = 5,
    IodPci6IrrBit      = 6,
    IodPci7IrrBit      = 7,
    IodPci8IrrBit      = 8,
    IodPci9IrrBit      = 9,
    IodPci10IrrBit     = 10,
    IodPci11IrrBit     = 11,
    IodPci12IrrBit     = 12,
    IodPci13IrrBit     = 13,
    IodPci14IrrBit     = 14,
    IodPci15IrrBit     = 15,
    IodEisaIrrBit      = 16,
    IodScsiIrrBit      = 16,
    IodI2cCtrlIrrBit   = 17,
    IodI2cBusIrrBit    = 18,
    IodEisaNmiIrrBit   = 21,
    IodSoftErrIrrBit   = 22,
    IodHardErrIrrBit   = 23

} IOD_IRR_BITS, *PIOD_IRR_BITS;

extern PIOD_VECTOR_DATA HalpIodVectorData;
extern PCPU_VECTOR_DATA HalpCpuVectorData;

extern MC_DEVICE_ID HalpProcessorMcDeviceId[];

extern LIST_ENTRY HalpIodVectorDataHead;
extern LIST_ENTRY HalpCpuVectorDataHead;

//
// Weighted list manipulation routines
//

PWEIGHTED_LIST_ENTRY
HalpFindWeightedList(
    PLIST_ENTRY ListHead,
    WEIGHTED_SEARCH_CRITERIA SearchCriteria
    );


//
// Rawhide interrupt routine prototypes.
//

#if 0
VOID
HalpFindAllPciVectors(
    IN PCONFIGURATION_COMPONENT_DATA Root
    );

VOID
HalpFindPciBusVectors(
    IN PCONFIGURATION_COMPONENT Component,
    IN PVOID ConfigurationData
    );

VOID
HalpInitializeIoVectorAffinity(
    PLOADER_PARAMETER_BLOCK AFFINITYerBlock
    );

VOID
HalpBalanceIoVectorLoad(
    PLIST_ENTRY pIodListHead
    );

VOID
HalpBalanceVectorLoadForIod(
    PIOD_VECTOR_DATA IodVectorData
    );

#endif

VOID
HalpInitializeVectorBalanceData(
    VOID
    );

VOID
HalpInitializeCpuVectorData(
    ULONG LogicalCpu
    );

VOID
HalpAssignPrimaryProcessorVectors(
    PLIST_ENTRY
    );

ULONG
HalpAssignInterruptForIod(
    PIOD_VECTOR_DATA IodVectorData,
    ULONG InterruptVector
    );
        
#ifdef HALDBG
VOID
HalpDumpIoVectorAffinity(
    VOID
    );
#endif

#endif // !defined (_LANGUAGE_ASSEMBLY)

#endif //_RWINTBALH_