00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#include "arbp.h"
00027
00028
00029
00030
00031
00032
00033
#if ARB_DBG
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 LONG
ArbDebugLevel = -1;
00044
00045
00046
00047
00048
00049
00050
00051
00052 ULONG
ArbStopOnError;
00053 ULONG
ArbReplayOnError;
00054
00055 PCHAR
ArbpActionStrings[] = {
00056
"ArbiterActionTestAllocation",
00057
"ArbiterActionRetestAllocation",
00058
"ArbiterActionCommitAllocation",
00059
"ArbiterActionRollbackAllocation",
00060
"ArbiterActionQueryAllocatedResources",
00061
"ArbiterActionWriteReservedResources",
00062
"ArbiterActionQueryConflict",
00063
"ArbiterActionQueryArbitrate",
00064
"ArbiterActionAddReserved",
00065
"ArbiterActionBootAllocation"
00066 };
00067
00068
VOID
00069 ArbDumpArbiterRange(
00070 LONG Level,
00071 PRTL_RANGE_LIST List,
00072 PUCHAR RangeText
00073 )
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 {
00094 PRTL_RANGE current;
00095 RTL_RANGE_LIST_ITERATOR iterator;
00096 BOOLEAN headerDisplayed =
FALSE;
00097
00098
PAGED_CODE();
00099
00100 FOR_ALL_RANGES(
List, &iterator, current) {
00101
00102
if (headerDisplayed ==
FALSE) {
00103 headerDisplayed =
TRUE;
00104
ARB_PRINT(Level, (
" %s:\n", RangeText));
00105 }
00106
00107
ARB_PRINT(Level,
00108 (
" %I64x-%I64x %s%s O=0x%08x U=0x%08x\n",
00109 current->Start,
00110 current->End,
00111 current->Flags & RTL_RANGE_SHARED ?
"S" :
" ",
00112 current->Flags & RTL_RANGE_CONFLICT ?
"C" :
" ",
00113 current->Owner,
00114 current->UserData
00115 ));
00116 }
00117
if (headerDisplayed ==
FALSE) {
00118
ARB_PRINT(Level, (
" %s: <None>\n", RangeText));
00119 }
00120 }
00121
00122
VOID
00123 ArbDumpArbiterInstance(
00124 LONG Level,
00125 PARBITER_INSTANCE Arbiter
00126 )
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 {
00147
00148
PAGED_CODE();
00149
00150
ARB_PRINT(Level,
00151 (
"---%S Arbiter State---\n",
00152 Arbiter->Name
00153 ));
00154
00155
ArbDumpArbiterRange(
00156 Level,
00157 Arbiter->Allocation,
00158
"Allocation"
00159 );
00160
00161
ArbDumpArbiterRange(
00162 Level,
00163 Arbiter->PossibleAllocation,
00164
"PossibleAllocation"
00165 );
00166 }
00167
00168
VOID
00169 ArbDumpArbitrationList(
00170 LONG Level,
00171 PLIST_ENTRY ArbitrationList
00172 )
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193 {
00194
PARBITER_LIST_ENTRY current;
00195 PIO_RESOURCE_DESCRIPTOR alternative;
00196
PDEVICE_OBJECT previousOwner =
NULL;
00197 UCHAR andOr =
' ';
00198
00199
PAGED_CODE();
00200
00201
ARB_PRINT(Level, (
"Arbitration List\n"));
00202
00203
FOR_ALL_IN_LIST(
ARBITER_LIST_ENTRY, ArbitrationList, current) {
00204
00205
if (previousOwner != current->
PhysicalDeviceObject) {
00206
00207 previousOwner = current->
PhysicalDeviceObject;
00208
00209
ARB_PRINT(
00210 Level,
00211 (
" Owning object 0x%08x\n",
00212 current->
PhysicalDeviceObject
00213 ));
00214
ARB_PRINT(
00215 Level,
00216 (
" Length Alignment Minimum Address - Maximum Address\n"
00217 ));
00218
00219 }
00220
00221
FOR_ALL_IN_ARRAY(current->
Alternatives,
00222 current->
AlternativeCount,
00223 alternative) {
00224
00225
ARB_PRINT(
00226 Level,
00227 (
"%c %8x %8x %08x%08x - %08x%08x %s\n",
00228 andOr,
00229 alternative->u.Generic.Length,
00230 alternative->u.Generic.Alignment,
00231 alternative->u.Generic.MinimumAddress.HighPart,
00232 alternative->u.Generic.MinimumAddress.LowPart,
00233 alternative->u.Generic.MaximumAddress.HighPart,
00234 alternative->u.Generic.MaximumAddress.LowPart,
00235 alternative->Type == CmResourceTypeMemory ?
00236
"Memory"
00237 :
"Port"
00238 ));
00239 andOr =
'|';
00240 }
00241 andOr =
'&';
00242 }
00243 }
00244
00245
#endif // ARB_DBG