Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenhalfuncs.h
Go to the documentation of this file.
00001 /* Hardware Abstraction Layer Functions */ 00002 00003 #if (NTDDI_VERSION >= NTDDI_WIN2K) 00004 00005 #if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) 00006 00007 $if (_WDMDDK_) 00008 __drv_preferredFunction("AllocateCommonBuffer","Obsolete") 00009 FORCEINLINE 00010 PVOID 00011 NTAPI 00012 HalAllocateCommonBuffer( 00013 _In_ PDMA_ADAPTER DmaAdapter, 00014 _In_ ULONG Length, 00015 _Out_ PPHYSICAL_ADDRESS LogicalAddress, 00016 _In_ BOOLEAN CacheEnabled) 00017 { 00018 PALLOCATE_COMMON_BUFFER allocateCommonBuffer; 00019 PVOID commonBuffer; 00020 00021 allocateCommonBuffer = *(DmaAdapter)->DmaOperations->AllocateCommonBuffer; 00022 ASSERT( allocateCommonBuffer != NULL ); 00023 commonBuffer = allocateCommonBuffer( DmaAdapter, Length, LogicalAddress, CacheEnabled ); 00024 return commonBuffer; 00025 } 00026 00027 __drv_preferredFunction("FreeCommonBuffer","Obsolete") 00028 FORCEINLINE 00029 VOID 00030 NTAPI 00031 HalFreeCommonBuffer( 00032 _In_ PDMA_ADAPTER DmaAdapter, 00033 _In_ ULONG Length, 00034 _In_ PHYSICAL_ADDRESS LogicalAddress, 00035 _In_ PVOID VirtualAddress, 00036 _In_ BOOLEAN CacheEnabled) 00037 { 00038 PFREE_COMMON_BUFFER freeCommonBuffer; 00039 00040 freeCommonBuffer = *(DmaAdapter)->DmaOperations->FreeCommonBuffer; 00041 ASSERT( freeCommonBuffer != NULL ); 00042 freeCommonBuffer( DmaAdapter, Length, LogicalAddress, VirtualAddress, CacheEnabled ); 00043 } 00044 00045 __drv_preferredFunction("ReadDmaCounter","Obsolete") 00046 FORCEINLINE 00047 ULONG 00048 NTAPI 00049 HalReadDmaCounter( 00050 _In_ PDMA_ADAPTER DmaAdapter) 00051 { 00052 PREAD_DMA_COUNTER readDmaCounter; 00053 ULONG counter; 00054 00055 readDmaCounter = *(DmaAdapter)->DmaOperations->ReadDmaCounter; 00056 ASSERT( readDmaCounter != NULL ); 00057 counter = readDmaCounter( DmaAdapter ); 00058 return counter; 00059 } 00060 00061 FORCEINLINE 00062 ULONG 00063 HalGetDmaAlignment( 00064 _In_ PDMA_ADAPTER DmaAdapter) 00065 { 00066 PGET_DMA_ALIGNMENT getDmaAlignment; 00067 ULONG alignment; 00068 00069 getDmaAlignment = *(DmaAdapter)->DmaOperations->GetDmaAlignment; 00070 ASSERT( getDmaAlignment != NULL ); 00071 alignment = getDmaAlignment( DmaAdapter ); 00072 return alignment; 00073 } 00074 00075 $endif (_WDMDDK_) 00076 $if (_NTDDK_) 00077 /* Nothing here */ 00078 00079 #else /* USE_DMA_MACROS ... */ 00080 00081 //DECLSPEC_DEPRECATED_DDK 00082 NTHALAPI 00083 VOID 00084 NTAPI 00085 IoFreeAdapterChannel( 00086 _In_ PADAPTER_OBJECT AdapterObject); 00087 00088 //DECLSPEC_DEPRECATED_DDK 00089 NTHALAPI 00090 BOOLEAN 00091 NTAPI 00092 IoFlushAdapterBuffers( 00093 _In_ PADAPTER_OBJECT AdapterObject, 00094 _In_ PMDL Mdl, 00095 _In_ PVOID MapRegisterBase, 00096 _In_ PVOID CurrentVa, 00097 _In_ ULONG Length, 00098 _In_ BOOLEAN WriteToDevice); 00099 00100 //DECLSPEC_DEPRECATED_DDK 00101 NTHALAPI 00102 VOID 00103 NTAPI 00104 IoFreeMapRegisters( 00105 _In_ PADAPTER_OBJECT AdapterObject, 00106 _In_ PVOID MapRegisterBase, 00107 _In_ ULONG NumberOfMapRegisters); 00108 00109 //DECLSPEC_DEPRECATED_DDK 00110 NTHALAPI 00111 PVOID 00112 NTAPI 00113 HalAllocateCommonBuffer( 00114 _In_ PADAPTER_OBJECT AdapterObject, 00115 _In_ ULONG Length, 00116 _Out_ PPHYSICAL_ADDRESS LogicalAddress, 00117 _In_ BOOLEAN CacheEnabled); 00118 00119 //DECLSPEC_DEPRECATED_DDK 00120 NTHALAPI 00121 VOID 00122 NTAPI 00123 HalFreeCommonBuffer( 00124 _In_ PADAPTER_OBJECT AdapterObject, 00125 _In_ ULONG Length, 00126 _In_ PHYSICAL_ADDRESS LogicalAddress, 00127 _In_ PVOID VirtualAddress, 00128 _In_ BOOLEAN CacheEnabled); 00129 00130 //DECLSPEC_DEPRECATED_DDK 00131 NTHALAPI 00132 ULONG 00133 NTAPI 00134 HalReadDmaCounter( 00135 _In_ PADAPTER_OBJECT AdapterObject); 00136 00137 NTHALAPI 00138 NTSTATUS 00139 NTAPI 00140 HalAllocateAdapterChannel( 00141 _In_ PADAPTER_OBJECT AdapterObject, 00142 _In_ PWAIT_CONTEXT_BLOCK Wcb, 00143 _In_ ULONG NumberOfMapRegisters, 00144 _In_ PDRIVER_CONTROL ExecutionRoutine); 00145 00146 $endif (_NTDDK_) 00147 #endif /* USE_DMA_MACROS ... */ 00148 00149 $if (_NTDDK_) 00150 #if !defined(NO_LEGACY_DRIVERS) 00151 NTHALAPI 00152 NTSTATUS 00153 NTAPI 00154 HalAssignSlotResources( 00155 _In_ PUNICODE_STRING RegistryPath, 00156 _In_opt_ PUNICODE_STRING DriverClassName, 00157 _In_ PDRIVER_OBJECT DriverObject, 00158 _In_ PDEVICE_OBJECT DeviceObject, 00159 _In_ INTERFACE_TYPE BusType, 00160 _In_ ULONG BusNumber, 00161 _In_ ULONG SlotNumber, 00162 _Inout_ PCM_RESOURCE_LIST *AllocatedResources); 00163 00164 _IRQL_requires_max_(PASSIVE_LEVEL) 00165 NTHALAPI 00166 ULONG 00167 NTAPI 00168 HalGetInterruptVector( 00169 _In_ INTERFACE_TYPE InterfaceType, 00170 _In_ ULONG BusNumber, 00171 _In_ ULONG BusInterruptLevel, 00172 _In_ ULONG BusInterruptVector, 00173 _Out_ PKIRQL Irql, 00174 _Out_ PKAFFINITY Affinity); 00175 00176 NTHALAPI 00177 ULONG 00178 NTAPI 00179 HalSetBusData( 00180 _In_ BUS_DATA_TYPE BusDataType, 00181 _In_ ULONG BusNumber, 00182 _In_ ULONG SlotNumber, 00183 _In_reads_bytes_(Length) PVOID Buffer, 00184 _In_ ULONG Length); 00185 00186 NTHALAPI 00187 ULONG 00188 NTAPI 00189 HalGetBusData( 00190 _In_ BUS_DATA_TYPE BusDataType, 00191 _In_ ULONG BusNumber, 00192 _In_ ULONG SlotNumber, 00193 _Out_writes_bytes_(Length) PVOID Buffer, 00194 _In_ ULONG Length); 00195 00196 NTHALAPI 00197 BOOLEAN 00198 NTAPI 00199 HalMakeBeep( 00200 _In_ ULONG Frequency); 00201 #endif /* !defined(NO_LEGACY_DRIVERS) */ 00202 00203 _IRQL_requires_max_(PASSIVE_LEVEL) 00204 NTHALAPI 00205 PADAPTER_OBJECT 00206 NTAPI 00207 HalGetAdapter( 00208 _In_ PDEVICE_DESCRIPTION DeviceDescription, 00209 _Out_ PULONG NumberOfMapRegisters); 00210 00211 VOID 00212 NTAPI 00213 HalPutDmaAdapter( 00214 _In_ PADAPTER_OBJECT DmaAdapter); 00215 00216 NTHALAPI 00217 VOID 00218 NTAPI 00219 HalAcquireDisplayOwnership( 00220 _In_ PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters); 00221 00222 NTHALAPI 00223 ULONG 00224 NTAPI 00225 HalGetBusDataByOffset( 00226 _In_ BUS_DATA_TYPE BusDataType, 00227 _In_ ULONG BusNumber, 00228 _In_ ULONG SlotNumber, 00229 _Out_writes_bytes_(Length) PVOID Buffer, 00230 _In_ ULONG Offset, 00231 _In_ ULONG Length); 00232 00233 NTHALAPI 00234 ULONG 00235 NTAPI 00236 HalSetBusDataByOffset( 00237 _In_ BUS_DATA_TYPE BusDataType, 00238 _In_ ULONG BusNumber, 00239 _In_ ULONG SlotNumber, 00240 _In_reads_bytes_(Length) PVOID Buffer, 00241 _In_ ULONG Offset, 00242 _In_ ULONG Length); 00243 00244 NTHALAPI 00245 BOOLEAN 00246 NTAPI 00247 HalTranslateBusAddress( 00248 _In_ INTERFACE_TYPE InterfaceType, 00249 _In_ ULONG BusNumber, 00250 _In_ PHYSICAL_ADDRESS BusAddress, 00251 _Inout_ PULONG AddressSpace, 00252 _Out_ PPHYSICAL_ADDRESS TranslatedAddress); 00253 00254 NTHALAPI 00255 PVOID 00256 NTAPI 00257 HalAllocateCrashDumpRegisters( 00258 _In_ PADAPTER_OBJECT AdapterObject, 00259 _Inout_ PULONG NumberOfMapRegisters); 00260 00261 NTSTATUS 00262 NTAPI 00263 HalGetScatterGatherList( 00264 _In_ PADAPTER_OBJECT DmaAdapter, 00265 _In_ PDEVICE_OBJECT DeviceObject, 00266 _In_ PMDL Mdl, 00267 _In_ PVOID CurrentVa, 00268 _In_ ULONG Length, 00269 _In_ PDRIVER_LIST_CONTROL ExecutionRoutine, 00270 _In_ PVOID Context, 00271 _In_ BOOLEAN WriteToDevice); 00272 00273 VOID 00274 NTAPI 00275 HalPutScatterGatherList( 00276 _In_ PADAPTER_OBJECT DmaAdapter, 00277 _In_ PSCATTER_GATHER_LIST ScatterGather, 00278 _In_ BOOLEAN WriteToDevice); 00279 00280 $endif (_NTDDK_) 00281 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */ 00282 00283 $if (_NTDDK_) 00284 #if (NTDDI_VERSION >= NTDDI_WINXP) 00285 _IRQL_requires_max_(PASSIVE_LEVEL) 00286 NTKERNELAPI 00287 VOID 00288 FASTCALL 00289 HalExamineMBR( 00290 _In_ PDEVICE_OBJECT DeviceObject, 00291 _In_ ULONG SectorSize, 00292 _In_ ULONG MBRTypeIdentifier, 00293 _Out_ PVOID *Buffer); 00294 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */ 00295 00296 #if (NTDDI_VERSION >= NTDDI_WIN7) 00297 00298 NTSTATUS 00299 NTAPI 00300 HalAllocateHardwareCounters( 00301 _In_reads_(GroupCount) PGROUP_AFFINITY GroupAffinty, 00302 _In_ ULONG GroupCount, 00303 _In_ PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList, 00304 _Out_ PHANDLE CounterSetHandle); 00305 00306 NTSTATUS 00307 NTAPI 00308 HalFreeHardwareCounters( 00309 _In_ HANDLE CounterSetHandle); 00310 00311 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ 00312 00313 #if defined(_IA64_) 00314 #if (NTDDI_VERSION >= NTDDI_WIN2K) 00315 NTHALAPI 00316 ULONG 00317 NTAPI 00318 HalGetDmaAlignmentRequirement(VOID); 00319 #endif 00320 #endif /* defined(_IA64_) */ 00321 00322 #if defined(_M_IX86) || defined(_M_AMD64) 00323 #define HalGetDmaAlignmentRequirement() 1L 00324 #endif 00325 00326 #if (NTDDI_VERSION >= NTDDI_WIN7) 00327 00328 typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR *PWHEA_ERROR_SOURCE_DESCRIPTOR; 00329 typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD; 00330 00331 NTHALAPI 00332 VOID 00333 NTAPI 00334 HalBugCheckSystem( 00335 _In_ PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, 00336 _In_ PWHEA_ERROR_RECORD ErrorRecord); 00337 00338 #else 00339 00340 typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD; 00341 00342 NTHALAPI 00343 VOID 00344 NTAPI 00345 HalBugCheckSystem( 00346 _In_ PWHEA_ERROR_RECORD ErrorRecord); 00347 00348 #endif /* (NTDDI_VERSION >= NTDDI_WIN7) */ 00349 00350 $endif (_NTDDK_) Generated on Sun May 27 2012 04:30:51 for ReactOS by
1.7.6.1
|