Deleted Added
full compact
hwesleep.c (234623) hwesleep.c (239340)
1/******************************************************************************
2 *
3 * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
4 * extended FADT-V5 sleep registers.
5 *
6 *****************************************************************************/
7
8/*

--- 85 unchanged lines hidden (view full) ---

94}
95
96
97/*******************************************************************************
98 *
99 * FUNCTION: AcpiHwExtendedSleep
100 *
101 * PARAMETERS: SleepState - Which sleep state to enter
1/******************************************************************************
2 *
3 * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
4 * extended FADT-V5 sleep registers.
5 *
6 *****************************************************************************/
7
8/*

--- 85 unchanged lines hidden (view full) ---

94}
95
96
97/*******************************************************************************
98 *
99 * FUNCTION: AcpiHwExtendedSleep
100 *
101 * PARAMETERS: SleepState - Which sleep state to enter
102 * Flags - ACPI_EXECUTE_GTS to run optional method
103 *
104 * RETURN: Status
105 *
106 * DESCRIPTION: Enter a system sleep state via the extended FADT sleep
107 * registers (V5 FADT).
108 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
109 *
110 ******************************************************************************/
111
112ACPI_STATUS
113AcpiHwExtendedSleep (
102 *
103 * RETURN: Status
104 *
105 * DESCRIPTION: Enter a system sleep state via the extended FADT sleep
106 * registers (V5 FADT).
107 * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
108 *
109 ******************************************************************************/
110
111ACPI_STATUS
112AcpiHwExtendedSleep (
114 UINT8 SleepState,
115 UINT8 Flags)
113 UINT8 SleepState)
116{
117 ACPI_STATUS Status;
118 UINT8 SleepTypeValue;
119 UINT64 SleepStatus;
120
121
122 ACPI_FUNCTION_TRACE (HwExtendedSleep);
123

--- 11 unchanged lines hidden (view full) ---

135 Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
136 if (ACPI_FAILURE (Status))
137 {
138 return_ACPI_STATUS (Status);
139 }
140
141 AcpiGbl_SystemAwakeAndRunning = FALSE;
142
114{
115 ACPI_STATUS Status;
116 UINT8 SleepTypeValue;
117 UINT64 SleepStatus;
118
119
120 ACPI_FUNCTION_TRACE (HwExtendedSleep);
121

--- 11 unchanged lines hidden (view full) ---

133 Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
134 if (ACPI_FAILURE (Status))
135 {
136 return_ACPI_STATUS (Status);
137 }
138
139 AcpiGbl_SystemAwakeAndRunning = FALSE;
140
143 /* Optionally execute _GTS (Going To Sleep) */
144
145 if (Flags & ACPI_EXECUTE_GTS)
146 {
147 AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState);
148 }
149
150 /* Flush caches, as per ACPI specification */
151
152 ACPI_FLUSH_CPU_CACHE ();
153
154 /*
155 * Set the SLP_TYP and SLP_EN bits.
156 *
157 * Note: We only use the first value returned by the \_Sx method

--- 28 unchanged lines hidden (view full) ---

186}
187
188
189/*******************************************************************************
190 *
191 * FUNCTION: AcpiHwExtendedWakePrep
192 *
193 * PARAMETERS: SleepState - Which sleep state we just exited
141 /* Flush caches, as per ACPI specification */
142
143 ACPI_FLUSH_CPU_CACHE ();
144
145 /*
146 * Set the SLP_TYP and SLP_EN bits.
147 *
148 * Note: We only use the first value returned by the \_Sx method

--- 28 unchanged lines hidden (view full) ---

177}
178
179
180/*******************************************************************************
181 *
182 * FUNCTION: AcpiHwExtendedWakePrep
183 *
184 * PARAMETERS: SleepState - Which sleep state we just exited
194 * Flags - ACPI_EXECUTE_BFS to run optional method
195 *
196 * RETURN: Status
197 *
198 * DESCRIPTION: Perform first part of OS-independent ACPI cleanup after
199 * a sleep. Called with interrupts ENABLED.
200 *
201 ******************************************************************************/
202
203ACPI_STATUS
204AcpiHwExtendedWakePrep (
185 *
186 * RETURN: Status
187 *
188 * DESCRIPTION: Perform first part of OS-independent ACPI cleanup after
189 * a sleep. Called with interrupts ENABLED.
190 *
191 ******************************************************************************/
192
193ACPI_STATUS
194AcpiHwExtendedWakePrep (
205 UINT8 SleepState,
206 UINT8 Flags)
195 UINT8 SleepState)
207{
208 ACPI_STATUS Status;
209 UINT8 SleepTypeValue;
210
211
212 ACPI_FUNCTION_TRACE (HwExtendedWakePrep);
213
214
215 Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
216 &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
217 if (ACPI_SUCCESS (Status))
218 {
219 SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
220 ACPI_X_SLEEP_TYPE_MASK);
221
222 (void) AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
223 &AcpiGbl_FADT.SleepControl);
224 }
225
196{
197 ACPI_STATUS Status;
198 UINT8 SleepTypeValue;
199
200
201 ACPI_FUNCTION_TRACE (HwExtendedWakePrep);
202
203
204 Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
205 &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
206 if (ACPI_SUCCESS (Status))
207 {
208 SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
209 ACPI_X_SLEEP_TYPE_MASK);
210
211 (void) AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
212 &AcpiGbl_FADT.SleepControl);
213 }
214
226 /* Optionally execute _BFS (Back From Sleep) */
227
228 if (Flags & ACPI_EXECUTE_BFS)
229 {
230 AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState);
231 }
232 return_ACPI_STATUS (AE_OK);
233}
234
235
236/*******************************************************************************
237 *
238 * FUNCTION: AcpiHwExtendedWake
239 *
240 * PARAMETERS: SleepState - Which sleep state we just exited
215 return_ACPI_STATUS (AE_OK);
216}
217
218
219/*******************************************************************************
220 *
221 * FUNCTION: AcpiHwExtendedWake
222 *
223 * PARAMETERS: SleepState - Which sleep state we just exited
241 * Flags - Reserved, set to zero
242 *
243 * RETURN: Status
244 *
245 * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
246 * Called with interrupts ENABLED.
247 *
248 ******************************************************************************/
249
250ACPI_STATUS
251AcpiHwExtendedWake (
224 *
225 * RETURN: Status
226 *
227 * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
228 * Called with interrupts ENABLED.
229 *
230 ******************************************************************************/
231
232ACPI_STATUS
233AcpiHwExtendedWake (
252 UINT8 SleepState,
253 UINT8 Flags)
234 UINT8 SleepState)
254{
255 ACPI_FUNCTION_TRACE (HwExtendedWake);
256
257
258 /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
259
260 AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
261

--- 16 unchanged lines hidden ---
235{
236 ACPI_FUNCTION_TRACE (HwExtendedWake);
237
238
239 /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
240
241 AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
242

--- 16 unchanged lines hidden ---