utosi.c revision 1.2.4.2 1 1.2.4.2 rmind /******************************************************************************
2 1.2.4.2 rmind *
3 1.2.4.2 rmind * Module Name: utosi - Support for the _OSI predefined control method
4 1.2.4.2 rmind *
5 1.2.4.2 rmind *****************************************************************************/
6 1.2.4.2 rmind
7 1.2.4.2 rmind /*
8 1.2.4.2 rmind * Copyright (C) 2000 - 2011, Intel Corp.
9 1.2.4.2 rmind * All rights reserved.
10 1.2.4.2 rmind *
11 1.2.4.2 rmind * Redistribution and use in source and binary forms, with or without
12 1.2.4.2 rmind * modification, are permitted provided that the following conditions
13 1.2.4.2 rmind * are met:
14 1.2.4.2 rmind * 1. Redistributions of source code must retain the above copyright
15 1.2.4.2 rmind * notice, this list of conditions, and the following disclaimer,
16 1.2.4.2 rmind * without modification.
17 1.2.4.2 rmind * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.2.4.2 rmind * substantially similar to the "NO WARRANTY" disclaimer below
19 1.2.4.2 rmind * ("Disclaimer") and any redistribution must be conditioned upon
20 1.2.4.2 rmind * including a substantially similar Disclaimer requirement for further
21 1.2.4.2 rmind * binary redistribution.
22 1.2.4.2 rmind * 3. Neither the names of the above-listed copyright holders nor the names
23 1.2.4.2 rmind * of any contributors may be used to endorse or promote products derived
24 1.2.4.2 rmind * from this software without specific prior written permission.
25 1.2.4.2 rmind *
26 1.2.4.2 rmind * Alternatively, this software may be distributed under the terms of the
27 1.2.4.2 rmind * GNU General Public License ("GPL") version 2 as published by the Free
28 1.2.4.2 rmind * Software Foundation.
29 1.2.4.2 rmind *
30 1.2.4.2 rmind * NO WARRANTY
31 1.2.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.2.4.2 rmind * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.2.4.2 rmind * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.2.4.2 rmind * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.2.4.2 rmind * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.2.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.2.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.2.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.2.4.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.2.4.2 rmind * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.2.4.2 rmind * POSSIBILITY OF SUCH DAMAGES.
42 1.2.4.2 rmind */
43 1.2.4.2 rmind
44 1.2.4.2 rmind #define __UTOSI_C__
45 1.2.4.2 rmind
46 1.2.4.2 rmind #include "acpi.h"
47 1.2.4.2 rmind #include "accommon.h"
48 1.2.4.2 rmind
49 1.2.4.2 rmind
50 1.2.4.2 rmind #define _COMPONENT ACPI_UTILITIES
51 1.2.4.2 rmind ACPI_MODULE_NAME ("utosi")
52 1.2.4.2 rmind
53 1.2.4.2 rmind /*
54 1.2.4.2 rmind * Strings supported by the _OSI predefined control method (which is
55 1.2.4.2 rmind * implemented internally within this module.)
56 1.2.4.2 rmind *
57 1.2.4.2 rmind * March 2009: Removed "Linux" as this host no longer wants to respond true
58 1.2.4.2 rmind * for this string. Basically, the only safe OS strings are windows-related
59 1.2.4.2 rmind * and in many or most cases represent the only test path within the
60 1.2.4.2 rmind * BIOS-provided ASL code.
61 1.2.4.2 rmind *
62 1.2.4.2 rmind * The last element of each entry is used to track the newest version of
63 1.2.4.2 rmind * Windows that the BIOS has requested.
64 1.2.4.2 rmind */
65 1.2.4.2 rmind static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
66 1.2.4.2 rmind {
67 1.2.4.2 rmind /* Operating System Vendor Strings */
68 1.2.4.2 rmind
69 1.2.4.2 rmind {__UNCONST("Windows 2000"), NULL, 0, ACPI_OSI_WIN_2000}, /* Windows 2000 */
70 1.2.4.2 rmind {__UNCONST("Windows 2001"), NULL, 0, ACPI_OSI_WIN_XP}, /* Windows XP */
71 1.2.4.2 rmind {__UNCONST("Windows 2001 SP1"), NULL, 0, ACPI_OSI_WIN_XP_SP1}, /* Windows XP SP1 */
72 1.2.4.2 rmind {__UNCONST("Windows 2001.1"), NULL, 0, ACPI_OSI_WINSRV_2003}, /* Windows Server 2003 */
73 1.2.4.2 rmind {__UNCONST("Windows 2001 SP2"), NULL, 0, ACPI_OSI_WIN_XP_SP2}, /* Windows XP SP2 */
74 1.2.4.2 rmind {__UNCONST("Windows 2001.1 SP1"), NULL, 0, ACPI_OSI_WINSRV_2003_SP1}, /* Windows Server 2003 SP1 - Added 03/2006 */
75 1.2.4.2 rmind {__UNCONST("Windows 2006"), NULL, 0, ACPI_OSI_WIN_VISTA}, /* Windows Vista - Added 03/2006 */
76 1.2.4.2 rmind {__UNCONST("Windows 2006.1"), NULL, 0, ACPI_OSI_WINSRV_2008}, /* Windows Server 2008 - Added 09/2009 */
77 1.2.4.2 rmind {__UNCONST("Windows 2006 SP1"), NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */
78 1.2.4.2 rmind {__UNCONST("Windows 2006 SP2"), NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
79 1.2.4.2 rmind {__UNCONST("Windows 2009"), NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
80 1.2.4.2 rmind
81 1.2.4.2 rmind /* Feature Group Strings */
82 1.2.4.2 rmind
83 1.2.4.2 rmind {__UNCONST("Extended Address Space Descriptor"), NULL, 0, 0}
84 1.2.4.2 rmind
85 1.2.4.2 rmind /*
86 1.2.4.2 rmind * All "optional" feature group strings (features that are implemented
87 1.2.4.2 rmind * by the host) should be dynamically added by the host via
88 1.2.4.2 rmind * AcpiInstallInterface and should not be manually added here.
89 1.2.4.2 rmind *
90 1.2.4.2 rmind * Examples of optional feature group strings:
91 1.2.4.2 rmind *
92 1.2.4.2 rmind * "Module Device"
93 1.2.4.2 rmind * "Processor Device"
94 1.2.4.2 rmind * "3.0 Thermal Model"
95 1.2.4.2 rmind * "3.0 _SCP Extensions"
96 1.2.4.2 rmind * "Processor Aggregator Device"
97 1.2.4.2 rmind */
98 1.2.4.2 rmind };
99 1.2.4.2 rmind
100 1.2.4.2 rmind
101 1.2.4.2 rmind /*******************************************************************************
102 1.2.4.2 rmind *
103 1.2.4.2 rmind * FUNCTION: AcpiUtInitializeInterfaces
104 1.2.4.2 rmind *
105 1.2.4.2 rmind * PARAMETERS: None
106 1.2.4.2 rmind *
107 1.2.4.2 rmind * RETURN: Status
108 1.2.4.2 rmind *
109 1.2.4.2 rmind * DESCRIPTION: Initialize the global _OSI supported interfaces list
110 1.2.4.2 rmind *
111 1.2.4.2 rmind ******************************************************************************/
112 1.2.4.2 rmind
113 1.2.4.2 rmind ACPI_STATUS
114 1.2.4.2 rmind AcpiUtInitializeInterfaces (
115 1.2.4.2 rmind void)
116 1.2.4.2 rmind {
117 1.2.4.2 rmind UINT32 i;
118 1.2.4.2 rmind
119 1.2.4.2 rmind
120 1.2.4.2 rmind (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
121 1.2.4.2 rmind AcpiGbl_SupportedInterfaces = AcpiDefaultSupportedInterfaces;
122 1.2.4.2 rmind
123 1.2.4.2 rmind /* Link the static list of supported interfaces */
124 1.2.4.2 rmind
125 1.2.4.2 rmind for (i = 0; i < (ACPI_ARRAY_LENGTH (AcpiDefaultSupportedInterfaces) - 1); i++)
126 1.2.4.2 rmind {
127 1.2.4.2 rmind AcpiDefaultSupportedInterfaces[i].Next =
128 1.2.4.2 rmind &AcpiDefaultSupportedInterfaces[(ACPI_SIZE) i + 1];
129 1.2.4.2 rmind }
130 1.2.4.2 rmind
131 1.2.4.2 rmind AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
132 1.2.4.2 rmind return (AE_OK);
133 1.2.4.2 rmind }
134 1.2.4.2 rmind
135 1.2.4.2 rmind
136 1.2.4.2 rmind /*******************************************************************************
137 1.2.4.2 rmind *
138 1.2.4.2 rmind * FUNCTION: AcpiUtInterfaceTerminate
139 1.2.4.2 rmind *
140 1.2.4.2 rmind * PARAMETERS: None
141 1.2.4.2 rmind *
142 1.2.4.2 rmind * RETURN: None
143 1.2.4.2 rmind *
144 1.2.4.2 rmind * DESCRIPTION: Delete all interfaces in the global list. Sets
145 1.2.4.2 rmind * AcpiGbl_SupportedInterfaces to NULL.
146 1.2.4.2 rmind *
147 1.2.4.2 rmind ******************************************************************************/
148 1.2.4.2 rmind
149 1.2.4.2 rmind void
150 1.2.4.2 rmind AcpiUtInterfaceTerminate (
151 1.2.4.2 rmind void)
152 1.2.4.2 rmind {
153 1.2.4.2 rmind ACPI_INTERFACE_INFO *NextInterface;
154 1.2.4.2 rmind
155 1.2.4.2 rmind
156 1.2.4.2 rmind (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
157 1.2.4.2 rmind NextInterface = AcpiGbl_SupportedInterfaces;
158 1.2.4.2 rmind
159 1.2.4.2 rmind while (NextInterface)
160 1.2.4.2 rmind {
161 1.2.4.2 rmind AcpiGbl_SupportedInterfaces = NextInterface->Next;
162 1.2.4.2 rmind
163 1.2.4.2 rmind /* Only interfaces added at runtime can be freed */
164 1.2.4.2 rmind
165 1.2.4.2 rmind if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
166 1.2.4.2 rmind {
167 1.2.4.2 rmind ACPI_FREE (NextInterface->Name);
168 1.2.4.2 rmind ACPI_FREE (NextInterface);
169 1.2.4.2 rmind }
170 1.2.4.2 rmind
171 1.2.4.2 rmind NextInterface = AcpiGbl_SupportedInterfaces;
172 1.2.4.2 rmind }
173 1.2.4.2 rmind
174 1.2.4.2 rmind AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
175 1.2.4.2 rmind }
176 1.2.4.2 rmind
177 1.2.4.2 rmind
178 1.2.4.2 rmind /*******************************************************************************
179 1.2.4.2 rmind *
180 1.2.4.2 rmind * FUNCTION: AcpiUtInstallInterface
181 1.2.4.2 rmind *
182 1.2.4.2 rmind * PARAMETERS: InterfaceName - The interface to install
183 1.2.4.2 rmind *
184 1.2.4.2 rmind * RETURN: Status
185 1.2.4.2 rmind *
186 1.2.4.2 rmind * DESCRIPTION: Install the interface into the global interface list.
187 1.2.4.2 rmind * Caller MUST hold AcpiGbl_OsiMutex
188 1.2.4.2 rmind *
189 1.2.4.2 rmind ******************************************************************************/
190 1.2.4.2 rmind
191 1.2.4.2 rmind ACPI_STATUS
192 1.2.4.2 rmind AcpiUtInstallInterface (
193 1.2.4.2 rmind ACPI_STRING InterfaceName)
194 1.2.4.2 rmind {
195 1.2.4.2 rmind ACPI_INTERFACE_INFO *InterfaceInfo;
196 1.2.4.2 rmind
197 1.2.4.2 rmind
198 1.2.4.2 rmind /* Allocate info block and space for the name string */
199 1.2.4.2 rmind
200 1.2.4.2 rmind InterfaceInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_INTERFACE_INFO));
201 1.2.4.2 rmind if (!InterfaceInfo)
202 1.2.4.2 rmind {
203 1.2.4.2 rmind return (AE_NO_MEMORY);
204 1.2.4.2 rmind }
205 1.2.4.2 rmind
206 1.2.4.2 rmind InterfaceInfo->Name = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (InterfaceName) + 1);
207 1.2.4.2 rmind if (!InterfaceInfo->Name)
208 1.2.4.2 rmind {
209 1.2.4.2 rmind ACPI_FREE (InterfaceInfo);
210 1.2.4.2 rmind return (AE_NO_MEMORY);
211 1.2.4.2 rmind }
212 1.2.4.2 rmind
213 1.2.4.2 rmind /* Initialize new info and insert at the head of the global list */
214 1.2.4.2 rmind
215 1.2.4.2 rmind ACPI_STRCPY (InterfaceInfo->Name, InterfaceName);
216 1.2.4.2 rmind InterfaceInfo->Flags = ACPI_OSI_DYNAMIC;
217 1.2.4.2 rmind InterfaceInfo->Next = AcpiGbl_SupportedInterfaces;
218 1.2.4.2 rmind
219 1.2.4.2 rmind AcpiGbl_SupportedInterfaces = InterfaceInfo;
220 1.2.4.2 rmind return (AE_OK);
221 1.2.4.2 rmind }
222 1.2.4.2 rmind
223 1.2.4.2 rmind
224 1.2.4.2 rmind /*******************************************************************************
225 1.2.4.2 rmind *
226 1.2.4.2 rmind * FUNCTION: AcpiUtRemoveInterface
227 1.2.4.2 rmind *
228 1.2.4.2 rmind * PARAMETERS: InterfaceName - The interface to remove
229 1.2.4.2 rmind *
230 1.2.4.2 rmind * RETURN: Status
231 1.2.4.2 rmind *
232 1.2.4.2 rmind * DESCRIPTION: Remove the interface from the global interface list.
233 1.2.4.2 rmind * Caller MUST hold AcpiGbl_OsiMutex
234 1.2.4.2 rmind *
235 1.2.4.2 rmind ******************************************************************************/
236 1.2.4.2 rmind
237 1.2.4.2 rmind ACPI_STATUS
238 1.2.4.2 rmind AcpiUtRemoveInterface (
239 1.2.4.2 rmind ACPI_STRING InterfaceName)
240 1.2.4.2 rmind {
241 1.2.4.2 rmind ACPI_INTERFACE_INFO *PreviousInterface;
242 1.2.4.2 rmind ACPI_INTERFACE_INFO *NextInterface;
243 1.2.4.2 rmind
244 1.2.4.2 rmind
245 1.2.4.2 rmind PreviousInterface = NextInterface = AcpiGbl_SupportedInterfaces;
246 1.2.4.2 rmind while (NextInterface)
247 1.2.4.2 rmind {
248 1.2.4.2 rmind if (!ACPI_STRCMP (InterfaceName, NextInterface->Name))
249 1.2.4.2 rmind {
250 1.2.4.2 rmind /* Found: name is in either the static list or was added at runtime */
251 1.2.4.2 rmind
252 1.2.4.2 rmind if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
253 1.2.4.2 rmind {
254 1.2.4.2 rmind /* Interface was added dynamically, remove and free it */
255 1.2.4.2 rmind
256 1.2.4.2 rmind if (PreviousInterface == NextInterface)
257 1.2.4.2 rmind {
258 1.2.4.2 rmind AcpiGbl_SupportedInterfaces = NextInterface->Next;
259 1.2.4.2 rmind }
260 1.2.4.2 rmind else
261 1.2.4.2 rmind {
262 1.2.4.2 rmind PreviousInterface->Next = NextInterface->Next;
263 1.2.4.2 rmind }
264 1.2.4.2 rmind
265 1.2.4.2 rmind ACPI_FREE (NextInterface->Name);
266 1.2.4.2 rmind ACPI_FREE (NextInterface);
267 1.2.4.2 rmind }
268 1.2.4.2 rmind else
269 1.2.4.2 rmind {
270 1.2.4.2 rmind /*
271 1.2.4.2 rmind * Interface is in static list. If marked invalid, then it
272 1.2.4.2 rmind * does not actually exist. Else, mark it invalid.
273 1.2.4.2 rmind */
274 1.2.4.2 rmind if (NextInterface->Flags & ACPI_OSI_INVALID)
275 1.2.4.2 rmind {
276 1.2.4.2 rmind return (AE_NOT_EXIST);
277 1.2.4.2 rmind }
278 1.2.4.2 rmind
279 1.2.4.2 rmind NextInterface->Flags |= ACPI_OSI_INVALID;
280 1.2.4.2 rmind }
281 1.2.4.2 rmind
282 1.2.4.2 rmind return (AE_OK);
283 1.2.4.2 rmind }
284 1.2.4.2 rmind
285 1.2.4.2 rmind PreviousInterface = NextInterface;
286 1.2.4.2 rmind NextInterface = NextInterface->Next;
287 1.2.4.2 rmind }
288 1.2.4.2 rmind
289 1.2.4.2 rmind /* Interface was not found */
290 1.2.4.2 rmind
291 1.2.4.2 rmind return (AE_NOT_EXIST);
292 1.2.4.2 rmind }
293 1.2.4.2 rmind
294 1.2.4.2 rmind
295 1.2.4.2 rmind /*******************************************************************************
296 1.2.4.2 rmind *
297 1.2.4.2 rmind * FUNCTION: AcpiUtGetInterface
298 1.2.4.2 rmind *
299 1.2.4.2 rmind * PARAMETERS: InterfaceName - The interface to find
300 1.2.4.2 rmind *
301 1.2.4.2 rmind * RETURN: ACPI_INTERFACE_INFO if found. NULL if not found.
302 1.2.4.2 rmind *
303 1.2.4.2 rmind * DESCRIPTION: Search for the specified interface name in the global list.
304 1.2.4.2 rmind * Caller MUST hold AcpiGbl_OsiMutex
305 1.2.4.2 rmind *
306 1.2.4.2 rmind ******************************************************************************/
307 1.2.4.2 rmind
308 1.2.4.2 rmind ACPI_INTERFACE_INFO *
309 1.2.4.2 rmind AcpiUtGetInterface (
310 1.2.4.2 rmind ACPI_STRING InterfaceName)
311 1.2.4.2 rmind {
312 1.2.4.2 rmind ACPI_INTERFACE_INFO *NextInterface;
313 1.2.4.2 rmind
314 1.2.4.2 rmind
315 1.2.4.2 rmind NextInterface = AcpiGbl_SupportedInterfaces;
316 1.2.4.2 rmind while (NextInterface)
317 1.2.4.2 rmind {
318 1.2.4.2 rmind if (!ACPI_STRCMP (InterfaceName, NextInterface->Name))
319 1.2.4.2 rmind {
320 1.2.4.2 rmind return (NextInterface);
321 1.2.4.2 rmind }
322 1.2.4.2 rmind
323 1.2.4.2 rmind NextInterface = NextInterface->Next;
324 1.2.4.2 rmind }
325 1.2.4.2 rmind
326 1.2.4.2 rmind return (NULL);
327 1.2.4.2 rmind }
328 1.2.4.2 rmind
329 1.2.4.2 rmind
330 1.2.4.2 rmind /*******************************************************************************
331 1.2.4.2 rmind *
332 1.2.4.2 rmind * FUNCTION: AcpiUtOsiImplementation
333 1.2.4.2 rmind *
334 1.2.4.2 rmind * PARAMETERS: WalkState - Current walk state
335 1.2.4.2 rmind *
336 1.2.4.2 rmind * RETURN: Status
337 1.2.4.2 rmind *
338 1.2.4.2 rmind * DESCRIPTION: Implementation of the _OSI predefined control method. When
339 1.2.4.2 rmind * an invocation of _OSI is encountered in the system AML,
340 1.2.4.2 rmind * control is transferred to this function.
341 1.2.4.2 rmind *
342 1.2.4.2 rmind ******************************************************************************/
343 1.2.4.2 rmind
344 1.2.4.2 rmind ACPI_STATUS
345 1.2.4.2 rmind AcpiUtOsiImplementation (
346 1.2.4.2 rmind ACPI_WALK_STATE *WalkState)
347 1.2.4.2 rmind {
348 1.2.4.2 rmind ACPI_OPERAND_OBJECT *StringDesc;
349 1.2.4.2 rmind ACPI_OPERAND_OBJECT *ReturnDesc;
350 1.2.4.2 rmind ACPI_INTERFACE_INFO *InterfaceInfo;
351 1.2.4.2 rmind ACPI_INTERFACE_HANDLER InterfaceHandler;
352 1.2.4.2 rmind UINT32 ReturnValue;
353 1.2.4.2 rmind
354 1.2.4.2 rmind
355 1.2.4.2 rmind ACPI_FUNCTION_TRACE (UtOsiImplementation);
356 1.2.4.2 rmind
357 1.2.4.2 rmind
358 1.2.4.2 rmind /* Validate the string input argument (from the AML caller) */
359 1.2.4.2 rmind
360 1.2.4.2 rmind StringDesc = WalkState->Arguments[0].Object;
361 1.2.4.2 rmind if (!StringDesc ||
362 1.2.4.2 rmind (StringDesc->Common.Type != ACPI_TYPE_STRING))
363 1.2.4.2 rmind {
364 1.2.4.2 rmind return_ACPI_STATUS (AE_TYPE);
365 1.2.4.2 rmind }
366 1.2.4.2 rmind
367 1.2.4.2 rmind /* Create a return object */
368 1.2.4.2 rmind
369 1.2.4.2 rmind ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
370 1.2.4.2 rmind if (!ReturnDesc)
371 1.2.4.2 rmind {
372 1.2.4.2 rmind return_ACPI_STATUS (AE_NO_MEMORY);
373 1.2.4.2 rmind }
374 1.2.4.2 rmind
375 1.2.4.2 rmind /* Default return value is 0, NOT SUPPORTED */
376 1.2.4.2 rmind
377 1.2.4.2 rmind ReturnValue = 0;
378 1.2.4.2 rmind (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
379 1.2.4.2 rmind
380 1.2.4.2 rmind /* Lookup the interface in the global _OSI list */
381 1.2.4.2 rmind
382 1.2.4.2 rmind InterfaceInfo = AcpiUtGetInterface (StringDesc->String.Pointer);
383 1.2.4.2 rmind if (InterfaceInfo &&
384 1.2.4.2 rmind !(InterfaceInfo->Flags & ACPI_OSI_INVALID))
385 1.2.4.2 rmind {
386 1.2.4.2 rmind /*
387 1.2.4.2 rmind * The interface is supported.
388 1.2.4.2 rmind * Update the OsiData if necessary. We keep track of the latest
389 1.2.4.2 rmind * version of Windows that has been requested by the BIOS.
390 1.2.4.2 rmind */
391 1.2.4.2 rmind if (InterfaceInfo->Value > AcpiGbl_OsiData)
392 1.2.4.2 rmind {
393 1.2.4.2 rmind AcpiGbl_OsiData = InterfaceInfo->Value;
394 1.2.4.2 rmind }
395 1.2.4.2 rmind
396 1.2.4.2 rmind ReturnValue = ACPI_UINT32_MAX;
397 1.2.4.2 rmind }
398 1.2.4.2 rmind
399 1.2.4.2 rmind AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
400 1.2.4.2 rmind
401 1.2.4.2 rmind /*
402 1.2.4.2 rmind * Invoke an optional _OSI interface handler. The host OS may wish
403 1.2.4.2 rmind * to do some interface-specific handling. For example, warn about
404 1.2.4.2 rmind * certain interfaces or override the true/false support value.
405 1.2.4.2 rmind */
406 1.2.4.2 rmind InterfaceHandler = AcpiGbl_InterfaceHandler;
407 1.2.4.2 rmind if (InterfaceHandler)
408 1.2.4.2 rmind {
409 1.2.4.2 rmind ReturnValue = InterfaceHandler (
410 1.2.4.2 rmind StringDesc->String.Pointer, ReturnValue);
411 1.2.4.2 rmind }
412 1.2.4.2 rmind
413 1.2.4.2 rmind ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
414 1.2.4.2 rmind "ACPI: BIOS _OSI(\"%s\") is %ssupported\n",
415 1.2.4.2 rmind StringDesc->String.Pointer, ReturnValue == 0 ? "not " : ""));
416 1.2.4.2 rmind
417 1.2.4.2 rmind /* Complete the return object */
418 1.2.4.2 rmind
419 1.2.4.2 rmind ReturnDesc->Integer.Value = ReturnValue;
420 1.2.4.2 rmind WalkState->ReturnDesc = ReturnDesc;
421 1.2.4.2 rmind return_ACPI_STATUS (AE_OK);
422 1.2.4.2 rmind }
423