Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

741 lines
18 KiB

  1. /*++
  2. Copyright (c) 1993 Digital Equipment Corporation
  3. Module Name:
  4. fwcallbk.h
  5. Abstract:
  6. This module defines the firmware vendor vector callbacks that
  7. will be implemented on all Alpha AXP platforms.
  8. Author:
  9. John DeRosa [DEC] 10-December-1993
  10. Revision History:
  11. 14-July-1994 John DeRosa [DEC]
  12. Added definitions for GetBusDataByOffset and SetBusDataByOffset.
  13. --*/
  14. #ifndef _FWCALLBK_
  15. #define _FWCALLBK_
  16. //
  17. // This module contains typedefs, which are not parsable by the assembler.
  18. //
  19. #ifndef _LANGUAGE_ASSEMBLY
  20. #include "arc.h"
  21. //
  22. // Define the structure used to pass information to the
  23. // ECU, and other ARC applications.
  24. //
  25. typedef struct _ARC_INFORMATION {
  26. //
  27. // The version number of this structure definition.
  28. //
  29. ULONG Version;
  30. //
  31. // A pointer to an argv-like array. Each entry is a search path
  32. // string.
  33. //
  34. // This is used to pass to the ECU a list of directories to search
  35. // through for configuration files. The definition passed back to
  36. // the ECU depends on both the platform it is running on and the
  37. // operating system selection in effect at the time that the call
  38. // to VenReturnArcInformation is made.
  39. //
  40. // Rules:
  41. //
  42. // 1. The end of the search list is marked with a NULL.
  43. // 2. Each entry must be a subset of a valid FAT filesystem.
  44. // 3. Each entry must start with "\\".
  45. // 4. Each entry must end with an ECU configuration file
  46. // prefix character. (Currently, we use ! and A.)
  47. //
  48. // It is possible that other configuration utilities might want to
  49. // use this search path someday.
  50. //
  51. PUCHAR * SearchPath;
  52. PUCHAR Reserved1;
  53. PUCHAR Reserved2;
  54. PUCHAR Reserved3;
  55. PUCHAR Reserved4;
  56. } ARC_INFORMATION, *PARC_INFORMATION;
  57. #define ARC_INFORMATION_VERSION 0
  58. //
  59. // Structure used to return system and processor information.
  60. //
  61. typedef struct _EXTENDED_SYSTEM_INFORMATION {
  62. ULONG ProcessorId;
  63. ULONG ProcessorRevision;
  64. ULONG ProcessorPageSize;
  65. ULONG NumberOfPhysicalAddressBits;
  66. ULONG MaximumAddressSpaceNumber;
  67. ULONG ProcessorCycleCounterPeriod;
  68. ULONG SystemRevision;
  69. UCHAR SystemSerialNumber[16];
  70. UCHAR FirmwareVersion[16];
  71. UCHAR FirmwareBuildTimeStamp[12]; // yymmdd.hhmm (Available as of 5.10)
  72. } EXTENDED_SYSTEM_INFORMATION, *PEXTENDED_SYSTEM_INFORMATION;
  73. //
  74. // Define structure used to call BIOS emulator. This mimics the
  75. // VIDEO_X86_BIOS_ARGUMENTS typedef in \nt\private\ntos\inc\video.h.
  76. //
  77. typedef struct X86_BIOS_ARGUMENTS {
  78. ULONG Eax;
  79. ULONG Ebx;
  80. ULONG Ecx;
  81. ULONG Edx;
  82. ULONG Esi;
  83. ULONG Edi;
  84. ULONG Ebp;
  85. } X86_BIOS_ARGUMENTS, *PX86_BIOS_ARGUMENTS;
  86. //
  87. // Define the firmware vendor specific entry point numbers that are
  88. // common to all Alpha AXP platforms.
  89. //
  90. typedef enum _VENDOR_GENERIC_ENTRY {
  91. AllocatePoolRoutine,
  92. StallExecutionRoutine,
  93. PrintRoutine,
  94. ReturnExtendedSystemInformationRoutine,
  95. VideoDisplayInitializeRoutine,
  96. EISAReadRegisterBufferUCHARRoutine,
  97. EISAWriteRegisterBufferUCHARRoutine,
  98. EISAReadPortUCHARRoutine,
  99. EISAReadPortUSHORTRoutine,
  100. EISAReadPortULONGRoutine,
  101. EISAWritePortUCHARRoutine,
  102. EISAWritePortUSHORTRoutine,
  103. EISAWritePortULONGRoutine,
  104. FreePoolRoutine,
  105. CallBiosRoutine,
  106. TranslateBusAddressRoutine,
  107. ReadPortUCHARRoutine,
  108. ReadPortUSHORTRoutine,
  109. ReadPortULONGRoutine,
  110. WritePortUCHARRoutine,
  111. WritePortUSHORTRoutine,
  112. WritePortULONGRoutine,
  113. ReadRegisterUCHARRoutine,
  114. ReadRegisterUSHORTRoutine,
  115. ReadRegisterULONGRoutine,
  116. WriteRegisterUCHARRoutine,
  117. WriteRegisterUSHORTRoutine,
  118. WriteRegisterULONGRoutine,
  119. GetBusDataByOffsetRoutine,
  120. SetBusDataByOffsetRoutine,
  121. WidePrintRoutine,
  122. ReturnLanguageIdRoutine,
  123. GetAdapterRoutine,
  124. AllocateCommonBufferRoutine,
  125. FreeCommonBufferRoutine,
  126. ReturnArcInformationRoutine,
  127. IssueSrbDirectRoutine,
  128. ReservedRoutine0,
  129. ReadWriteErrorFrameRoutine,
  130. MaximumVendorRoutine
  131. } VENDOR_GENERIC_ENTRY;
  132. //
  133. // Define vendor specific routine types.
  134. //
  135. typedef
  136. PVOID
  137. (*PVEN_ALLOCATE_POOL_ROUTINE) (
  138. IN ULONG NumberOfBytes
  139. );
  140. typedef
  141. VOID
  142. (*PVEN_STALL_EXECUTION_ROUTINE) (
  143. IN ULONG Microseconds
  144. );
  145. typedef
  146. ULONG
  147. (*PVEN_PRINT_ROUTINE) (
  148. IN PCHAR Format,
  149. ...
  150. );
  151. typedef
  152. ULONG
  153. (*PVEN_WIDE_PRINT_ROUTINE) (
  154. IN PWCHAR Format,
  155. ...
  156. );
  157. typedef
  158. LONG
  159. (*PVEN_RETURN_LANGUAGE_ID_ROUTINE) (
  160. IN VOID
  161. );
  162. typedef
  163. VOID
  164. (*PVEN_RETURN_EXTENDED_SYSTEM_INFORMATION_ROUTINE) (
  165. OUT PEXTENDED_SYSTEM_INFORMATION SystemInfo
  166. );
  167. typedef
  168. ARC_STATUS
  169. (*PVEN_VIDEO_DISPLAY_INITIALIZE_ROUTINE) (
  170. OUT PVOID UnusedParameter
  171. );
  172. typedef
  173. ULONG
  174. (*PVEN_EISA_READ_REGISTER_BUFFER_UCHAR_ROUTINE) (
  175. IN ULONG BusNumber,
  176. IN ULONG Offset,
  177. OUT PVOID Buffer,
  178. IN ULONG Length
  179. );
  180. typedef
  181. ULONG
  182. (*PVEN_EISA_WRITE_REGISTER_BUFFER_UCHAR_ROUTINE) (
  183. IN ULONG BusNumber,
  184. IN ULONG Offset,
  185. OUT PVOID Buffer,
  186. IN ULONG Length
  187. );
  188. typedef
  189. UCHAR
  190. (*PVEN_EISA_READ_PORT_UCHAR_ROUTINE) (
  191. IN ULONG BusNumber,
  192. IN ULONG Offset
  193. );
  194. typedef
  195. USHORT
  196. (*PVEN_EISA_READ_PORT_USHORT_ROUTINE) (
  197. IN ULONG BusNumber,
  198. IN ULONG Offset
  199. );
  200. typedef
  201. ULONG
  202. (*PVEN_EISA_READ_PORT_ULONG_ROUTINE) (
  203. IN ULONG BusNumber,
  204. IN ULONG Offset
  205. );
  206. typedef
  207. VOID
  208. (*PVEN_EISA_WRITE_PORT_UCHAR_ROUTINE) (
  209. IN ULONG BusNumber,
  210. IN ULONG Offset,
  211. IN UCHAR Datum
  212. );
  213. typedef
  214. VOID
  215. (*PVEN_EISA_WRITE_PORT_USHORT_ROUTINE) (
  216. IN ULONG BusNumber,
  217. IN ULONG Offset,
  218. IN USHORT Datum
  219. );
  220. typedef
  221. VOID
  222. (*PVEN_EISA_WRITE_PORT_ULONG_ROUTINE) (
  223. IN ULONG BusNumber,
  224. IN ULONG Offset,
  225. IN ULONG Datum
  226. );
  227. typedef
  228. VOID
  229. (*PVEN_FREE_POOL_ROUTINE) (
  230. IN PVOID MemoryPointer
  231. );
  232. typedef
  233. VOID
  234. (*PVEN_CALL_BIOS_ROUTINE) (
  235. IN ULONG InterruptNumber,
  236. IN OUT PX86_BIOS_ARGUMENTS BiosArguments
  237. );
  238. typedef
  239. BOOLEAN
  240. (*PVEN_TRANSLATE_BUS_ADDRESS_ROUTINE) (
  241. IN INTERFACE_TYPE InterfaceType,
  242. IN ULONG BusNumber,
  243. IN PHYSICAL_ADDRESS BusAddress,
  244. IN OUT PULONG AddressSpace,
  245. OUT PPHYSICAL_ADDRESS TranslatedAddress
  246. );
  247. typedef
  248. UCHAR
  249. (*PVEN_READ_PORT_UCHAR_ROUTINE) (
  250. PUCHAR Port
  251. );
  252. typedef
  253. USHORT
  254. (*PVEN_READ_PORT_USHORT_ROUTINE) (
  255. PUSHORT Port
  256. );
  257. typedef
  258. ULONG
  259. (*PVEN_READ_PORT_ULONG_ROUTINE) (
  260. PULONG Port
  261. );
  262. typedef
  263. VOID
  264. (*PVEN_WRITE_PORT_UCHAR_ROUTINE) (
  265. PUCHAR Port,
  266. UCHAR Value
  267. );
  268. typedef
  269. VOID
  270. (*PVEN_WRITE_PORT_USHORT_ROUTINE) (
  271. PUSHORT Port,
  272. USHORT Value
  273. );
  274. typedef
  275. VOID
  276. (*PVEN_WRITE_PORT_ULONG_ROUTINE) (
  277. PULONG Port,
  278. ULONG Value
  279. );
  280. typedef
  281. UCHAR
  282. (*PVEN_READ_REGISTER_UCHAR_ROUTINE) (
  283. PUCHAR Register
  284. );
  285. typedef
  286. USHORT
  287. (*PVEN_READ_REGISTER_USHORT_ROUTINE) (
  288. PUSHORT Register
  289. );
  290. typedef
  291. ULONG
  292. (*PVEN_READ_REGISTER_ULONG_ROUTINE) (
  293. PULONG Register
  294. );
  295. typedef
  296. VOID
  297. (*PVEN_WRITE_REGISTER_UCHAR_ROUTINE) (
  298. PUCHAR Register,
  299. UCHAR Value
  300. );
  301. typedef
  302. VOID
  303. (*PVEN_WRITE_REGISTER_USHORT_ROUTINE) (
  304. PUSHORT Register,
  305. USHORT Value
  306. );
  307. typedef
  308. VOID
  309. (*PVEN_WRITE_REGISTER_ULONG_ROUTINE) (
  310. PULONG Register,
  311. ULONG Value
  312. );
  313. typedef
  314. ULONG
  315. (*PVEN_GET_BUS_DATA_BY_OFFSET_ROUTINE) (
  316. IN BUS_DATA_TYPE BusDataType,
  317. IN ULONG BusNumber,
  318. IN ULONG SlotNumber,
  319. IN PVOID Buffer,
  320. IN ULONG Offset,
  321. IN ULONG Length
  322. );
  323. typedef
  324. ULONG
  325. (*PVEN_SET_BUS_DATA_BY_OFFSET_ROUTINE) (
  326. IN BUS_DATA_TYPE BusDataType,
  327. IN ULONG BusNumber,
  328. IN ULONG SlotNumber,
  329. IN PVOID Buffer,
  330. IN ULONG Offset,
  331. IN ULONG Length
  332. );
  333. typedef
  334. PADAPTER_OBJECT
  335. (*PVEN_GET_ADAPTER_ROUTINE) (
  336. IN PDEVICE_DESCRIPTION DeviceDescription,
  337. IN OUT PULONG NumberOfMapRegisters
  338. );
  339. typedef
  340. PVOID
  341. (*PVEN_ALLOCATE_COMMON_BUFFER_ROUTINE) (
  342. IN PADAPTER_OBJECT AdapterObject,
  343. IN ULONG Length,
  344. OUT PPHYSICAL_ADDRESS LogicalAddress,
  345. IN BOOLEAN CacheEnabled
  346. );
  347. typedef
  348. VOID
  349. (*PVEN_FREE_COMMON_BUFFER_ROUTINE) (
  350. IN PADAPTER_OBJECT AdapterObject,
  351. IN ULONG Length,
  352. IN PHYSICAL_ADDRESS LogicalAddress,
  353. IN PVOID VirtualAddress,
  354. IN BOOLEAN CacheEnabled
  355. );
  356. typedef
  357. ARC_STATUS
  358. (*PVEN_RETURN_ARC_INFORMATION_ROUTINE) (
  359. OUT PARC_INFORMATION ArcInformation
  360. );
  361. typedef
  362. ARC_STATUS
  363. (*PVEN_ISSUE_SRB_DIRECT_ROUTINE) (
  364. UCHAR ScsiAdapterId,
  365. UCHAR PathId,
  366. UCHAR TargetId,
  367. UCHAR LunId,
  368. PVOID Srb,
  369. PVOID BufferAddress,
  370. ULONG BufferLength,
  371. BOOLEAN WriteToDevice
  372. );
  373. typedef
  374. ARC_STATUS
  375. (*PVEN_READ_WRITE_ERROR_FRAME_ROUTINE) (
  376. ULONG ReadWrite,
  377. ULONG FrameType,
  378. PVOID FrameAddress,
  379. PLONG FrameSize,
  380. ULONG FrameNumber
  381. );
  382. //
  383. // Define the stub function prototypes necessary to interface with the
  384. // 32-bit firmware on 64-bit systems.
  385. //
  386. // These routines are required for the 64-bit system until (if) 64-bit
  387. // firmware is ever supplied.
  388. //
  389. #if defined(_AXP64_) && defined(_NTHAL_)
  390. VOID
  391. HalpVenCallBios(
  392. IN ULONG InterruptNumber,
  393. IN OUT PX86_BIOS_ARGUMENTS BiosArguments
  394. );
  395. ARC_STATUS
  396. HalpVenReadWriteErrorFrame(
  397. IN ULONG ReadWrite,
  398. IN ULONG FrameType,
  399. IN OUT PVOID FrameAddress,
  400. IN OUT PLONG FrameSize,
  401. IN ULONG FrameNumber
  402. );
  403. VOID
  404. HalpVenVideoDisplayInitialize(
  405. OUT PVOID UnusedParameter
  406. );
  407. #endif
  408. //
  409. // Define vendor specific macros for use by programs that run on
  410. // Alpha AXP NT firmware.
  411. //
  412. // These calls are guaranteed to return legitimate values. If a function
  413. // is not defined for a particular platform, it will return with an error
  414. // code or just return normally, as appropriate.
  415. //
  416. #define VenAllocatePool(NumberOfBytes) \
  417. ((PVEN_ALLOCATE_POOL_ROUTINE)(SYSTEM_BLOCK->VendorVector[AllocatePoolRoutine])) \
  418. ((NumberOfBytes))
  419. #define VenStallExecution(Microseconds) \
  420. ((PVEN_STALL_EXECUTION_ROUTINE)(SYSTEM_BLOCK->VendorVector[StallExecutionRoutine])) \
  421. ((Microseconds))
  422. #define VenReturnLanguageId \
  423. ((PVEN_RETURN_LANGUAGE_ID_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReturnLanguageIdRoutine]))
  424. #define VenWPrint \
  425. ((PVEN_WIDE_PRINT_ROUTINE)(SYSTEM_BLOCK->VendorVector[WidePrintRoutine]))
  426. #define VenPrint \
  427. ((PVEN_PRINT_ROUTINE)(SYSTEM_BLOCK->VendorVector[PrintRoutine]))
  428. //
  429. // N.B. VenPrint1 and VenPrint2 are retained here for backwards compatibility.
  430. //
  431. #define VenPrint1 VenPrint
  432. #define VenPrint2 VenPrint
  433. #define VenReturnExtendedSystemInformation(x) \
  434. ((PVEN_RETURN_EXTENDED_SYSTEM_INFORMATION_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReturnExtendedSystemInformationRoutine]))(x)
  435. #if defined(_AXP64_) && defined(_NTHAL_)
  436. __inline
  437. VOID
  438. VenVideoDisplayInitialize(
  439. OUT PVOID UnusedParameter
  440. )
  441. {
  442. KIRQL OldIrql = FwAcquireFirmwareLock();
  443. HalpVenVideoDisplayInitialize(UnusedParameter);
  444. FwReleaseFirmwareLock(OldIrql);
  445. return;
  446. }
  447. #else
  448. #define VenVideoDisplayInitialize(x) \
  449. ((PVEN_VIDEO_DISPLAY_INITIALIZE_ROUTINE)(SYSTEM_BLOCK->VendorVector[VideoDisplayInitializeRoutine]))(x)
  450. #endif
  451. #define VenEISAReadRegisterBufferUCHAR(BusNumber, Offset, Buffer, Length) \
  452. ((PVEN_EISA_READ_REGISTER_BUFFER_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAReadRegisterBufferUCHARRoutine])) \
  453. ((BusNumber), (Offset), (Buffer), (Length))
  454. #define VenEISAWriteRegisterBufferUCHAR(BusNumber, Offset, Buffer, Length) \
  455. ((PVEN_EISA_WRITE_REGISTER_BUFFER_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAWriteRegisterBufferUCHARRoutine])) \
  456. ((BusNumber), (Offset), (Buffer), (Length))
  457. #define VenEISAReadPortUCHAR(BusNumber, Offset) \
  458. ((PVEN_EISA_READ_PORT_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAReadPortUCHARRoutine])) \
  459. ((BusNumber), (Offset))
  460. #define VenEISAReadPortUSHORT(BusNumber, Offset) \
  461. ((PVEN_EISA_READ_PORT_USHORT_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAReadPortUSHORTRoutine])) \
  462. ((BusNumber), (Offset))
  463. #define VenEISAReadPortULONG(BusNumber, Offset) \
  464. ((PVEN_EISA_READ_PORT_ULONG_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAReadPortULONGRoutine])) \
  465. ((BusNumber), (Offset))
  466. #define VenEISAWritePortUCHAR(BusNumber, Offset, Datum) \
  467. ((PVEN_EISA_WRITE_PORT_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAWritePortUCHARRoutine])) \
  468. ((BusNumber), (Offset), (Datum))
  469. #define VenEISAWritePortUSHORT(BusNumber, Offset, Datum) \
  470. ((PVEN_EISA_WRITE_PORT_USHORT_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAWritePortUSHORTRoutine])) \
  471. ((BusNumber), (Offset), (Datum))
  472. #define VenEISAWritePortULONG(BusNumber, Offset, Datum) \
  473. ((PVEN_EISA_WRITE_PORT_ULONG_ROUTINE)(SYSTEM_BLOCK->VendorVector[EISAWritePortULONGRoutine])) \
  474. ((BusNumber), (Offset), (Datum))
  475. #define VenFreePool(MemoryPointer) \
  476. ((PVEN_FREE_POOL_ROUTINE)(SYSTEM_BLOCK->VendorVector[FreePoolRoutine])) \
  477. ((MemoryPointer))
  478. #if defined(_AXP64_) && defined(_NTHAL_)
  479. __inline
  480. VOID
  481. VenCallBios(
  482. IN ULONG InterruptNumber,
  483. IN OUT PX86_BIOS_ARGUMENTS BiosArguments
  484. )
  485. {
  486. KIRQL OldIrql = FwAcquireFirmwareLock();
  487. HalpVenCallBios(InterruptNumber, BiosArguments);
  488. FwReleaseFirmwareLock(OldIrql);
  489. return;
  490. }
  491. #else
  492. #define VenCallBios(InterruptNumber, BiosArguments) \
  493. ((PVEN_CALL_BIOS_ROUTINE)(SYSTEM_BLOCK->VendorVector[CallBiosRoutine])) \
  494. ((InterruptNumber), (BiosArguments))
  495. #endif
  496. #define VenTranslateBusAddress(InterfaceType, BusNumber, BusAddress, AddressSpace, TranslatedAddress) \
  497. ((PVEN_TRANSLATE_BUS_ADDRESS_ROUTINE)(SYSTEM_BLOCK->VendorVector[TranslateBusAddressRoutine])) \
  498. ((InterfaceType), (BusNumber), (BusAddress), (AddressSpace), (TranslatedAddress))
  499. #define VenReadPortUCHAR(Port) \
  500. ((PVEN_READ_PORT_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReadPortUCHARRoutine])) \
  501. ((Port))
  502. #define VenReadPortUSHORT(Port) \
  503. ((PVEN_READ_PORT_USHORT_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReadPortUSHORTRoutine])) \
  504. ((Port))
  505. #define VenReadPortULONG(Port) \
  506. ((PVEN_READ_PORT_ULONG_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReadPortULONGRoutine])) \
  507. ((Port))
  508. #define VenWritePortUCHAR(Port, Value) \
  509. ((PVEN_WRITE_PORT_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[WritePortUCHARRoutine])) \
  510. ((Port), (Value))
  511. #define VenWritePortUSHORT(Port, Value) \
  512. ((PVEN_WRITE_PORT_USHORT_ROUTINE)(SYSTEM_BLOCK->VendorVector[WritePortUSHORTRoutine])) \
  513. ((Port), (Value))
  514. #define VenWritePortULONG(Port, Value) \
  515. ((PVEN_WRITE_PORT_ULONG_ROUTINE)(SYSTEM_BLOCK->VendorVector[WritePortULONGRoutine])) \
  516. ((Port), (Value))
  517. #define VenReadRegisterUCHAR(Register) \
  518. ((PVEN_READ_REGISTER_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReadRegisterUCHARRoutine])) \
  519. ((Register))
  520. #define VenReadRegisterUSHORT(Register) \
  521. ((PVEN_READ_REGISTER_USHORT_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReadRegisterUSHORTRoutine])) \
  522. ((Register))
  523. #define VenReadRegisterULONG(Register) \
  524. ((PVEN_READ_REGISTER_ULONG_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReadRegisterULONGRoutine])) \
  525. ((Register))
  526. #define VenWriteRegisterUCHAR(Register, Value) \
  527. ((PVEN_WRITE_REGISTER_UCHAR_ROUTINE)(SYSTEM_BLOCK->VendorVector[WriteRegisterUCHARRoutine])) \
  528. ((Register), (Value))
  529. #define VenWriteRegisterUSHORT(Register, Value) \
  530. ((PVEN_WRITE_REGISTER_USHORT_ROUTINE)(SYSTEM_BLOCK->VendorVector[WriteRegisterUSHORTRoutine])) \
  531. ((Register), (Value))
  532. #define VenWriteRegisterULONG(Register, Value) \
  533. ((PVEN_WRITE_REGISTER_ULONG_ROUTINE)(SYSTEM_BLOCK->VendorVector[WriteRegisterULONGRoutine])) \
  534. ((Register), (Value))
  535. #define VenGetBusDataByOffset(BusDataType, BusNumber, SlotNumber, Buffer, Offset, Length) \
  536. ((PVEN_GET_BUS_DATA_BY_OFFSET_ROUTINE)(SYSTEM_BLOCK->VendorVector[GetBusDataByOffsetRoutine])) \
  537. ((BusDataType), (BusNumber), (SlotNumber), (Buffer), (Offset), (Length))
  538. #define VenSetBusDataByOffset(BusDataType, BusNumber, SlotNumber, Buffer, Offset, Length) \
  539. ((PVEN_SET_BUS_DATA_BY_OFFSET_ROUTINE)(SYSTEM_BLOCK->VendorVector[SetBusDataByOffsetRoutine])) \
  540. ((BusDataType), (BusNumber), (SlotNumber), (Buffer), (Offset), (Length))
  541. #define VenGetAdapter(DeviceDescription, NumberOfMapRegisters) \
  542. ((PVEN_GET_ADAPTER_ROUTINE)(SYSTEM_BLOCK->VendorVector[GetAdapterRoutine])) \
  543. ((DeviceDescription), (NumberOfMapRegisters))
  544. #define VenAllocateCommonBuffer(AdapterObject, Length, LogicalAddress, CacheEnabled) \
  545. ((PVEN_ALLOCATE_COMMON_BUFFER_ROUTINE)(SYSTEM_BLOCK->VendorVector[AllocateCommonBufferRoutine])) \
  546. ((AdapterObject), (Length), (LogicalAddress), (CacheEnabled))
  547. #define VenFreeCommonBuffer(AdapterObject, Length, LogicalAddress, VirtualAddress, CacheEnabled) \
  548. ((PVEN_FREE_COMMON_BUFFER_ROUTINE)(SYSTEM_BLOCK->VendorVector[FreeCommonBufferRoutine])) \
  549. ((AdapterObject), (Length), (LogicalAddress), (VirtualAddress), (CacheEnabled))
  550. #define VenReturnArcInformation(ArcInfo) \
  551. ((PVEN_RETURN_ARC_INFORMATION_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReturnArcInformationRoutine])) \
  552. ((ArcInfo))
  553. #define VenIssueSrbDirect(ScsiAdapterId, PathId, TargetId, LunId, Srb, BufferAddress, BufferLength, WriteToDevice) \
  554. ((PVEN_ISSUE_SRB_DIRECT_ROUTINE)(SYSTEM_BLOCK->VendorVector[IssueSrbDirectRoutine])) \
  555. ((ScsiAdapterId), (PathId), (TargetId), (LunId), (Srb), (BufferAddress), (BufferLength), (WriteToDevice))
  556. //
  557. // As we are extending the vendor array here. Let's check the AlphaBIOS
  558. // has set the CDS tree up to support th extension. If not, don't do the call.
  559. //
  560. //
  561. // Define the params used for the Error Logging callbacks.
  562. //
  563. typedef enum _VENDOR_READWRITE_TYPE {
  564. ReadFrame = 1,
  565. WriteFrame
  566. } VENDOR_READWRITE_TYPE;
  567. typedef enum _VENDOR_READWRITE_FRAMETYPE {
  568. FatalErrorFrame = 1,
  569. DoubleErrorFrame,
  570. FRUErrorFrame
  571. } VENDOR_READWRITE_FRAMETYPE;
  572. #if defined(_AXP64_) && defined(_NTHAL_)
  573. __inline
  574. ARC_STATUS
  575. VenReadWriteErrorFrame(
  576. IN ULONG ReadWrite,
  577. IN ULONG FrameType,
  578. IN OUT PVOID FrameAddress,
  579. IN OUT PLONG FrameSize,
  580. IN ULONG FrameNumber
  581. )
  582. {
  583. ARC_STATUS Status;
  584. KIRQL OldIrql = FwAcquireFirmwareLock();
  585. Status = HalpVenReadWriteErrorFrame(ReadWrite,
  586. FrameType,
  587. FrameAddress,
  588. FrameSize,
  589. FrameNumber);
  590. FwReleaseFirmwareLock(OldIrql);
  591. return Status;
  592. }
  593. #else
  594. #define VenReadWriteErrorFrame(ReadWrite, Frametype, FrameAddress, FrameSizeAddress, FrameNumber) \
  595. (SYSTEM_BLOCK->VendorVectorLength > (ReadWriteErrorFrameRoutine * sizeof(SYSTEM_BLOCK->VendorVector[0])) ? \
  596. ((PVEN_READ_WRITE_ERROR_FRAME_ROUTINE)(SYSTEM_BLOCK->VendorVector[ReadWriteErrorFrameRoutine])) \
  597. ((ReadWrite), (Frametype), (FrameAddress), (FrameSizeAddress), (FrameNumber)) : \
  598. (EINVAL)) // Return bad status if vector not present.
  599. #endif
  600. #endif // _LANGUAGE_ASSEMBLY not defined
  601. #endif // _FWCALLBK_
  602.