Windows NT 4.0 source code leak
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.

133 lines
3.4 KiB

4 years ago
  1. //#pragma comment(exestr, "$Header: /usr4/winnt/SOURCES/ddk35/src/hal/halsni/mips/RCS/jxmapio.c,v 1.1 1994/10/13 15:47:06 holli Exp $")
  2. /*++
  3. Copyright (c) 1993 - 1994 Siemens Nixdorf Informationssysteme AG
  4. Copyright (c) 1991 - 1994 Microsoft Corporation
  5. Module Name:
  6. jxmapio.c
  7. Abstract:
  8. This module implements the mapping of HAL I/O space for a SNI
  9. or R4x00 system.
  10. For use of EISA I/O Space during phase 0 we go via KSEG1_BASE
  11. Environment:
  12. Kernel mode
  13. --*/
  14. #include "halp.h"
  15. //
  16. // Put all code for HAL initialization in the INIT section. It will be
  17. // deallocated by memory management when phase 1 initialization is
  18. // completed.
  19. //
  20. #if defined(ALLOC_PRAGMA)
  21. #pragma alloc_text(INIT, HalpMapIoSpace)
  22. #endif
  23. //
  24. // Define global data used to locate the EISA control space and the realtime
  25. // clock registers.
  26. //
  27. PVOID HalpEisaControlBase =(PVOID) (EISA_CONTROL_PHYSICAL_BASE | KSEG1_BASE);
  28. PVOID HalpOnboardControlBase=(PVOID) (RM200_ONBOARD_CONTROL_PHYSICAL_BASE | KSEG1_BASE);
  29. PVOID HalpEisaMemoryBase =(PVOID) (EISA_MEMORY_PHYSICAL_BASE | KSEG1_BASE);
  30. BOOLEAN
  31. HalpMapIoSpace (
  32. VOID
  33. )
  34. /*++
  35. Routine Description:
  36. This routine maps the HAL I/O space for a MIPS R4x00 SNI
  37. system (Phase 1, so the mapping goes via MmMapIoSpace()).
  38. Arguments:
  39. None.
  40. Return Value:
  41. If the initialization is successfully completed, than a value of TRUE
  42. is returned. Otherwise, a value of FALSE is returned.
  43. --*/
  44. {
  45. PHYSICAL_ADDRESS physicalAddress;
  46. //
  47. // Map EISA control space. Map all 16 slots. This is done so the NMI
  48. // code can probe the cards.
  49. // (64KB I/O Space)
  50. //
  51. physicalAddress.HighPart = 0;
  52. physicalAddress.LowPart = EISA_CONTROL_PHYSICAL_BASE;
  53. HalpEisaControlBase = MmMapIoSpace(physicalAddress,
  54. PAGE_SIZE * 16,
  55. FALSE);
  56. //
  57. // for the sni deskop model, may need an extra address space
  58. // HalpEisaExtensionInstalled can only be TRUE on RM200 (Desktop)
  59. //
  60. if (HalpEisaExtensionInstalled) {
  61. physicalAddress.HighPart = 0;
  62. physicalAddress.LowPart = RM200_ONBOARD_CONTROL_PHYSICAL_BASE;
  63. HalpOnboardControlBase = MmMapIoSpace(physicalAddress,
  64. PAGE_SIZE * 16,
  65. FALSE);
  66. } else
  67. //
  68. // In the SNI Minitower model, we have only one
  69. // address space
  70. //
  71. HalpOnboardControlBase = HalpEisaControlBase;
  72. //
  73. // Map EISA memory space so the x86 bios emulator emulator can
  74. // initialze a video adapter in an EISA/Isa slot.
  75. // (first 1MB only to have access to Card Bioses)
  76. // We do not have to call HalTranslateBusAddress on our SNI machines,
  77. // because we always use EISA_MEMORY_PHYSICAL_BASE for Extension Cards
  78. // on all machines
  79. //
  80. physicalAddress.HighPart = 0;
  81. physicalAddress.LowPart = EISA_MEMORY_PHYSICAL_BASE;
  82. HalpEisaMemoryBase = MmMapIoSpace(physicalAddress,
  83. PAGE_SIZE * 256,
  84. FALSE);
  85. //
  86. // If either mapped address is NULL, then return FALSE as the function
  87. // value. Otherwise, return TRUE.
  88. //
  89. if ((HalpEisaControlBase == NULL) ||
  90. (HalpOnboardControlBase == NULL) ||
  91. (HalpEisaMemoryBase == NULL)) {
  92. return FALSE;
  93. } else {
  94. return TRUE;
  95. }
  96. }