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.

153 lines
3.0 KiB

4 years ago
  1. #ident "@(#) NEC jxmapio.c 1.6 94/10/17 11:37:41"
  2. /*++
  3. Copyright (c) 1991-1994 Microsoft Corporation
  4. Module Name:
  5. jxmapio.c
  6. Abstract:
  7. This module implements the mapping of HAL I/O space a MIPS R3000
  8. or R4000 Jazz system.
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. --*/
  13. /*
  14. * Original source: Build Number 1.612
  15. *
  16. * Modify for R98(MIPS/R4400)
  17. *
  18. ***********************************************************************
  19. *
  20. * S001 94.06/02 T.Samezima
  21. *
  22. * Del I/O space mapping
  23. *
  24. * Add set kseg1 base I/O address
  25. *
  26. ***********************************************************************
  27. *
  28. * S002 94.6/10 T.Samezima
  29. *
  30. * Del Compile err
  31. *
  32. ***********************************************************************
  33. *
  34. * S003 94.7/5 T.Samezima
  35. *
  36. * Del Error check
  37. *
  38. * K000 94/10/11 N.Kugimoto
  39. * Fix 807 Base
  40. */
  41. #include "halp.h"
  42. //
  43. // Put all code for HAL initialization in the INIT section. It will be
  44. // deallocated by memory management when phase 1 initialization is
  45. // completed.
  46. //
  47. #if defined(ALLOC_PRAGMA)
  48. #pragma alloc_text(INIT, HalpMapIoSpace)
  49. #endif
  50. //
  51. // Define global data used to locate the EISA control space and the realtime
  52. // clock registers.
  53. //
  54. PVOID HalpEisaControlBase;
  55. PVOID HalpEisaMemoryBase; //K000
  56. PVOID HalpRealTimeClockBase;
  57. BOOLEAN
  58. HalpMapIoSpace (
  59. VOID
  60. )
  61. /*++
  62. Routine Description:
  63. This routine maps the HAL I/O space for a MIPS R3000 or R4000 Jazz
  64. system.
  65. Arguments:
  66. None.
  67. Return Value:
  68. If the initialization is successfully completed, than a value of TRUE
  69. is returned. Otherwise, a value of FALSE is returned.
  70. --*/
  71. {
  72. /* Start M001 */
  73. #if !defined(_R98_)
  74. PHYSICAL_ADDRESS physicalAddress;
  75. //
  76. // Map EISA control space. Map all 16 slots. This is done so the NMI
  77. // code can probe the cards.
  78. //
  79. physicalAddress.HighPart = 0;
  80. physicalAddress.LowPart = EISA_CONTROL_PHYSICAL_BASE;
  81. HalpEisaControlBase = MmMapIoSpace(physicalAddress,
  82. PAGE_SIZE * 16,
  83. FALSE);
  84. //
  85. // Map realtime clock registers.
  86. //
  87. physicalAddress.LowPart = RTCLOCK_PHYSICAL_BASE;
  88. HalpRealTimeClockBase = MmMapIoSpace(physicalAddress,
  89. PAGE_SIZE,
  90. FALSE);
  91. #else // #if !defined(_R98_)
  92. //
  93. // set EISA control space.
  94. //
  95. HalpEisaControlBase = (PVOID)(KSEG1_BASE + EISA_CONTROL_PHYSICAL_BASE); // S002
  96. //
  97. // set realtime clock registers.
  98. //
  99. HalpRealTimeClockBase = (PVOID)(KSEG1_BASE + RTCLOCK_PHYSICAL_BASE); // S002
  100. #endif // #if !defined(_R98_)
  101. /* End M001 */
  102. //
  103. // If either mapped address is NULL, then return FALSE as the function
  104. // value. Otherwise, return TRUE.
  105. //
  106. /* Start S003 */
  107. // if ((HalpEisaControlBase == NULL) ||
  108. // (HalpRealTimeClockBase == NULL)) {
  109. // return FALSE;
  110. // } else {
  111. // return TRUE;
  112. // }
  113. return TRUE;
  114. /* End S003 */
  115. }