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.

103 lines
2.1 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. //
  72. // All ACPI register accesses is now done via these macros
  73. //
  74. #define READ_ACPI_REGISTER(AcpiReg, Register) ((*AcpiReadRegisterRoutine)((AcpiReg), (Register)))
  75. #define WRITE_ACPI_REGISTER(AcpiReg, Register, Value) ((*AcpiWriteRegisterRoutine)((AcpiReg), (Register), (Value)))
  76. #endif // _ACPIIO_H_