proc.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /*++
  2. Copyright (c) 2015 Minoca Corp. All Rights Reserved
  3. Module Name:
  4. proc.h
  5. Abstract:
  6. This header contains definitions for ACPI processor devices.
  7. Author:
  8. Evan Green 28-Sep-2015
  9. --*/
  10. //
  11. // ------------------------------------------------------------------- Includes
  12. //
  13. //
  14. // ---------------------------------------------------------------- Definitions
  15. //
  16. #define ACPI_MAX_CSTATES 8
  17. #define ACPI_CSTATE_HALT 0x00000001
  18. #define ACPI_CSTATE_IO_HALT 0x00000002
  19. #define ACPI_CSTATE_MWAIT 0x00000004
  20. #define ACPI_CSTATE_BUS_MASTER_AVOIDANCE 0x00000008
  21. //
  22. // ------------------------------------------------------ Data Type Definitions
  23. //
  24. typedef enum _ACPI_CSTATE_TYPE {
  25. AcpiC1 = 1,
  26. AcpiC2 = 2,
  27. AcpiC3 = 3
  28. } ACPI_CSTATE_TYPE, *PACPI_CSTATE_TYPE;
  29. /*++
  30. Structure Description:
  31. This structure defines ACPI C-state information.
  32. Members:
  33. Register - Stores the register location needed to enter this C-state.
  34. Type - Stores the C-state type semantics. C-states higher than threee use
  35. type three.
  36. Latency - Stores the worst case latency to enter and exit this C-state, in
  37. microseconds.
  38. Power - Stores the average power consumption of the processor when in this
  39. C-state, in milliwatts.
  40. Flags - Stores a bitfield of flags about this C-state. See ACPI_CSTATE_*
  41. definitions.
  42. --*/
  43. typedef struct _ACPI_CSTATE {
  44. GENERIC_ADDRESS Register;
  45. ACPI_CSTATE_TYPE Type;
  46. ULONG Latency;
  47. ULONG Power;
  48. ULONG Flags;
  49. } ACPI_CSTATE, *PACPI_CSTATE;
  50. /*++
  51. Structure Description:
  52. This structure defines system-wide context for ACPI processor management.
  53. Members:
  54. CStateInterface - Stores the C-State interface with the OS.
  55. Processors - Stores the array of processor context structures, indexed by
  56. OS processor index (not ACPI processor numbers).
  57. ProcessorCount - Stores the number of processors in the array.
  58. StartedProcessorCount - Stores the number of processor devices that have
  59. been successfully started.
  60. --*/
  61. typedef struct _ACPI_PROCESSOR_GLOBAL_CONTEXT {
  62. PM_IDLE_STATE_INTERFACE CStateInterface;
  63. PACPI_PROCESSOR_CONTEXT Processors;
  64. ULONG ProcessorCount;
  65. ULONG StartedProcessorCount;
  66. } ACPI_PROCESSOR_GLOBAL_CONTEXT, *PACPI_PROCESSOR_GLOBAL_CONTEXT;
  67. /*++
  68. Structure Description:
  69. This structure stores information about an ACPI processor device.
  70. Members:
  71. AcpiId - Stores the ACPI processor ID. This should match up with the MADT
  72. entries.
  73. OsId - Stores the OS logical processor index.
  74. BlockAddress - Stores the P_BLK control address for this processor.
  75. BlockSize - Stores the size of the P_BLK region in bytes.
  76. Flags - Stores a bitfield of flags. See ACPI_PROCESSOR_* definitions.
  77. OsCStates - Stores the OS enumeration information for each C-state.
  78. CStateCount - Stores the number of C-states enumerated.
  79. HighestNonC3 - Stores the index of the highest C state that is not C3 type.
  80. --*/
  81. struct _ACPI_PROCESSOR_CONTEXT {
  82. ULONG AcpiId;
  83. ULONG OsId;
  84. ULONG BlockAddress;
  85. ULONG BlockSize;
  86. ULONG Flags;
  87. ACPI_CSTATE AcpiCStates[ACPI_MAX_CSTATES];
  88. PM_IDLE_STATE OsCStates[ACPI_MAX_CSTATES];
  89. ULONG CStateCount;
  90. ULONG HighestNonC3;
  91. };
  92. //
  93. // -------------------------------------------------------------------- Globals
  94. //
  95. //
  96. // -------------------------------------------------------- Function Prototypes
  97. //
  98. KSTATUS
  99. AcpipProcessorStart (
  100. PACPI_DEVICE_CONTEXT Device
  101. );
  102. /*++
  103. Routine Description:
  104. This routine starts an ACPI processor object.
  105. Arguments:
  106. Device - Supplies a pointer to the ACPI information associated with
  107. the processor device.
  108. Return Value:
  109. Status code.
  110. --*/
  111. KSTATUS
  112. AcpipArchInitializeProcessorManagement (
  113. PACPI_OBJECT NamespaceObject
  114. );
  115. /*++
  116. Routine Description:
  117. This routine is called to perform architecture-specific initialization for
  118. ACPI-based processor power management.
  119. Arguments:
  120. NamespaceObject - Supplies the namespace object of this processor.
  121. Return Value:
  122. Status code.
  123. --*/
  124. VOID
  125. AcpipEnterCState (
  126. PPM_IDLE_PROCESSOR_STATE Processor,
  127. ULONG State
  128. );
  129. /*++
  130. Routine Description:
  131. This routine prototype represents a function that is called to go into a
  132. given idle state on the current processor. This routine is called with
  133. interrupts disabled, and should return with interrupts disabled.
  134. Arguments:
  135. Processor - Supplies a pointer to the information for the current processor.
  136. State - Supplies the new state index to change to.
  137. Return Value:
  138. None. It is assumed when this function returns that the idle state was
  139. entered and then exited.
  140. --*/