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.

108 lines
2.0 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. jxmapio.c
  5. Abstract:
  6. This module implements the mapping of HAL I/O space a MIPS R3000
  7. or R4000 Jazz system.
  8. Author:
  9. David N. Cutler (davec) 28-Apr-1991
  10. Environment:
  11. Kernel mode
  12. Revision History:
  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;
  28. PVOID HalpEisaMemoryBase;
  29. PVOID HalpRealTimeClockBase;
  30. BOOLEAN
  31. HalpMapIoSpace (
  32. VOID
  33. )
  34. /*++
  35. Routine Description:
  36. This routine maps the HAL I/O space for a MIPS R3000 or R4000 Jazz
  37. system.
  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. //
  50. physicalAddress.HighPart = 0;
  51. physicalAddress.LowPart = EISA_CONTROL_PHYSICAL_BASE;
  52. HalpEisaControlBase = MmMapIoSpace(physicalAddress,
  53. PAGE_SIZE * 16,
  54. FALSE);
  55. //
  56. // Map realtime clock registers.
  57. //
  58. physicalAddress.LowPart = RTCLOCK_PHYSICAL_BASE;
  59. HalpRealTimeClockBase = MmMapIoSpace(physicalAddress,
  60. PAGE_SIZE,
  61. FALSE);
  62. //
  63. // If either mapped address is NULL, then return FALSE as the function
  64. // value. Otherwise, return TRUE.
  65. //
  66. if ((HalpEisaControlBase == NULL) ||
  67. (HalpRealTimeClockBase == NULL)) {
  68. return FALSE;
  69. } else {
  70. return TRUE;
  71. }
  72. }