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.

101 lines
2.1 KiB

  1. /*
  2. * ACPIGPIO.C -- ACPI OS Independent functions for low-level General-Purpose Event register I/O.
  3. *
  4. * Notes:
  5. *
  6. * This file provides OS independent functions that are called to read/write the GPE registers,
  7. * perform index <--> register translation, and to validate index values.
  8. *
  9. * This is the only place where the GPE0 and GPE1 blocks are differentiated.
  10. *
  11. */
  12. #include "pch.h"
  13. UCHAR
  14. ACPIReadGpeStatusRegister (
  15. ULONG Register
  16. )
  17. /*++
  18. Routine Description:
  19. Read a GPE status register. Differentiation between GP0 and GP1 is
  20. handled here.
  21. Arguments:
  22. Register - The GPE status register to read. Registers are numbered sequentially,
  23. GP0 block first, then GP1 block appended.
  24. Return Value:
  25. The value of the status register
  26. --*/
  27. {
  28. return (UCHAR) READ_ACPI_REGISTER(GP_STATUS, Register);
  29. }
  30. VOID
  31. ACPIWriteGpeStatusRegister (
  32. ULONG Register,
  33. UCHAR Value
  34. )
  35. /*++
  36. Routine Description:
  37. Write a GPE status register. Differentiation between GP0 and GP1 is
  38. handled here.
  39. Arguments:
  40. Register - The GPE status register to write. Registers are numbered sequentially,
  41. GP0 block first, then GP1 block appended.
  42. Value - The value to be written
  43. Return Value:
  44. None
  45. --*/
  46. {
  47. WRITE_ACPI_REGISTER(GP_STATUS, Register, (USHORT) Value);
  48. }
  49. VOID
  50. ACPIWriteGpeEnableRegister (
  51. ULONG Register,
  52. UCHAR Value
  53. )
  54. /*++
  55. Routine Description:
  56. Write a GPE Enable register. Differentiation between GP0 and GP1 is
  57. handled here.
  58. Arguments:
  59. Register - The GPE enable register to write. Registers are numbered sequentially,
  60. GP0 block first, then GP1 block appended.
  61. Value - The value to be written
  62. Return Value:
  63. None
  64. --*/
  65. {
  66. ACPIPrint( (
  67. ACPI_PRINT_DPC,
  68. "ACPIWriteGpeEnableRegister: Writing GPE Enable register %x = %x\n",
  69. Register, Value
  70. ) );
  71. WRITE_ACPI_REGISTER(GP_ENABLE, Register, (USHORT) Value);
  72. }