Leaked source code of windows server 2003
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.

130 lines
2.6 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. acpiio.h
  5. Abstract:
  6. ACPI OS Independent I/O routines
  7. We probably need a spinlock or some other form of protection to
  8. make the split read and writes atomic
  9. Author:
  10. Jason Clark (JasonCl)
  11. Stephane Plante (SPlante)
  12. Environment:
  13. NT Kernel Model Driver only
  14. Revision History:
  15. Eric Nelson October, '98 - Add READ/WRITE_ACPI_REGISTER
  16. --*/
  17. #ifndef _ACPIIO_H_
  18. #define _ACPIIO_H_
  19. //
  20. // Flags for WRITE_PM1_CONTROL
  21. //
  22. #define WRITE_REGISTER_A_BIT 0
  23. #define WRITE_REGISTER_A (1 << WRITE_REGISTER_A_BIT)
  24. #define WRITE_REGISTER_B_BIT 1
  25. #define WRITE_REGISTER_B (1 << WRITE_REGISTER_B_BIT)
  26. #define WRITE_SCI_BIT 2
  27. #define WRITE_SCI (1 << WRITE_SCI_BIT)
  28. #define WRITE_REGISTER_A_AND_B WRITE_REGISTER_A+WRITE_REGISTER_B
  29. #define WRITE_REGISTER_A_AND_B_SCI WRITE_REGISTER_A+WRITE_REGISTER_B+WRITE_SCI
  30. ULONG
  31. ACPIIoReadPm1Status(
  32. VOID
  33. );
  34. VOID
  35. CLEAR_PM1_STATUS_BITS(
  36. USHORT BitMask
  37. );
  38. #define ACPIIoClearPm1Status CLEAR_PM1_STATUS_BITS
  39. VOID
  40. CLEAR_PM1_STATUS_REGISTER(
  41. VOID
  42. );
  43. USHORT
  44. READ_PM1_CONTROL(
  45. VOID
  46. );
  47. USHORT
  48. READ_PM1_ENABLE(
  49. VOID
  50. );
  51. USHORT
  52. READ_PM1_STATUS(
  53. VOID
  54. );
  55. VOID
  56. WRITE_PM1_CONTROL(
  57. USHORT Value,
  58. BOOLEAN Destructive,
  59. ULONG Flags
  60. );
  61. VOID
  62. WRITE_PM1_ENABLE(
  63. USHORT Value
  64. );
  65. //
  66. // From acpiio.c, these point to DefRead/WriteAcpiRegister
  67. // by default (x86)
  68. //
  69. extern PREAD_ACPI_REGISTER AcpiReadRegisterRoutine;
  70. extern PWRITE_ACPI_REGISTER AcpiWriteRegisterRoutine;
  71. USHORT
  72. DefPortReadAcpiRegister(
  73. ACPI_REG_TYPE AcpiReg,
  74. ULONG Register
  75. );
  76. VOID
  77. DefPortWriteAcpiRegister(
  78. ACPI_REG_TYPE AcpiReg,
  79. ULONG Register,
  80. USHORT Value
  81. );
  82. USHORT
  83. DefRegisterReadAcpiRegister(
  84. ACPI_REG_TYPE AcpiReg,
  85. ULONG Register
  86. );
  87. VOID
  88. DefRegisterWriteAcpiRegister(
  89. ACPI_REG_TYPE AcpiReg,
  90. ULONG Register,
  91. USHORT Value
  92. );
  93. //
  94. // All ACPI register accesses is now done via these macros
  95. //
  96. #define READ_ACPI_REGISTER(AcpiReg, Register) ((*AcpiReadRegisterRoutine)((AcpiReg), (Register)))
  97. #define WRITE_ACPI_REGISTER(AcpiReg, Register, Value) ((*AcpiWriteRegisterRoutine)((AcpiReg), (Register), (Value)))
  98. #endif // _ACPIIO_H_