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.

90 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1990, 1991 Microsoft Corporation
  3. Module Name:
  4. hwheap.c
  5. Abstract:
  6. This is the Mca hardware detection module. Its main function is
  7. to detect various mca related hardware.
  8. Author:
  9. Shie-Lin Tzong (shielint) 21-Jan-92
  10. Environment:
  11. Real mode.
  12. Revision History:
  13. --*/
  14. #include "hwdetect.h"
  15. //
  16. // Define the size of POS data = ( slot 0 - 8 + VideoSubsystem) * (2 id bytes + 4 POS bytes)
  17. //
  18. #define POS_DATA_SIZE (10 * 6)
  19. #if !defined(_GAMBIT_)
  20. extern
  21. VOID
  22. CollectPs2PosData (
  23. FPVOID Buffer
  24. );
  25. #endif // _GAMBIT_
  26. VOID
  27. GetMcaPosData(
  28. FPVOID Buffer,
  29. FPULONG Size
  30. )
  31. /*++
  32. Routine Description:
  33. This routine collects all the mca slot POS and Id information
  34. and stores it in the caller supplied Buffer and
  35. returns the size of the data.
  36. Arguments:
  37. Buffer - A pointer to a PVOID to recieve the address of configuration
  38. data.
  39. Size - a pointer to a ULONG to receive the size of the configuration
  40. data.
  41. Return Value:
  42. None.
  43. --*/
  44. {
  45. FPUCHAR ConfigurationData;
  46. ULONG Length;
  47. Length = POS_DATA_SIZE + DATA_HEADER_SIZE;
  48. ConfigurationData = (FPVOID)HwAllocateHeap(Length, FALSE);
  49. #if !defined(_GAMBIT_)
  50. CollectPs2PosData(ConfigurationData + DATA_HEADER_SIZE);
  51. #endif
  52. HwSetUpFreeFormDataHeader((FPHWRESOURCE_DESCRIPTOR_LIST)ConfigurationData,
  53. 0,
  54. 0,
  55. 0,
  56. (ULONG)POS_DATA_SIZE
  57. );
  58. *(FPULONG)Buffer = PtrToUlong(ConfigurationData);
  59. *Size = Length;
  60. }