Subversion Repositories Kolibri OS

Rev

Rev 1498 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1498 Rev 2216
Line 6... Line 6...
6
 
6
 
7
/******************************************************************************
7
/******************************************************************************
8
 *
8
 *
9
 * 1. Copyright Notice
9
 * 1. Copyright Notice
10
 *
10
 *
11
 * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
11
 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp.
12
 * All rights reserved.
12
 * All rights reserved.
13
 *
13
 *
14
 * 2. License
14
 * 2. License
15
 *
15
 *
Line 122... Line 122...
122
 
122
 
123
#define _COMPONENT          ACPI_UTILITIES
123
#define _COMPONENT          ACPI_UTILITIES
Line 124... Line -...
124
        ACPI_MODULE_NAME    ("uteval")
-
 
125
 
-
 
126
 
-
 
127
/*
-
 
128
 * Strings supported by the _OSI predefined (internal) method.
-
 
129
 *
-
 
130
 * March 2009: Removed "Linux" as this host no longer wants to respond true
-
 
131
 * for this string. Basically, the only safe OS strings are windows-related
-
 
132
 * and in many or most cases represent the only test path within the
-
 
133
 * BIOS-provided ASL code.
-
 
134
 *
-
 
135
 * The second element of each entry is used to track the newest version of
-
 
136
 * Windows that the BIOS has requested.
-
 
137
 */
-
 
138
static const ACPI_INTERFACE_INFO    AcpiInterfacesSupported[] =
-
 
139
{
-
 
140
    /* Operating System Vendor Strings */
-
 
141
 
-
 
142
    {"Windows 2000",        ACPI_OSI_WIN_2000},         /* Windows 2000 */
-
 
143
    {"Windows 2001",        ACPI_OSI_WIN_XP},           /* Windows XP */
-
 
144
    {"Windows 2001 SP1",    ACPI_OSI_WIN_XP_SP1},       /* Windows XP SP1 */
-
 
145
    {"Windows 2001.1",      ACPI_OSI_WINSRV_2003},      /* Windows Server 2003 */
-
 
146
    {"Windows 2001 SP2",    ACPI_OSI_WIN_XP_SP2},       /* Windows XP SP2 */
-
 
147
    {"Windows 2001.1 SP1",  ACPI_OSI_WINSRV_2003_SP1},  /* Windows Server 2003 SP1 - Added 03/2006 */
-
 
148
    {"Windows 2006",        ACPI_OSI_WIN_VISTA},        /* Windows Vista - Added 03/2006 */
-
 
149
    {"Windows 2006.1",      ACPI_OSI_WINSRV_2008},      /* Windows Server 2008 - Added 09/2009 */
-
 
150
    {"Windows 2006 SP1",    ACPI_OSI_WIN_VISTA_SP1},    /* Windows Vista SP1 - Added 09/2009 */
-
 
151
    {"Windows 2009",        ACPI_OSI_WIN_7},            /* Windows 7 and Server 2008 R2 - Added 09/2009 */
-
 
152
 
-
 
153
    /* Feature Group Strings */
-
 
154
 
-
 
155
    {"Extended Address Space Descriptor", 0}
-
 
156
 
-
 
157
    /*
-
 
158
     * All "optional" feature group strings (features that are implemented
-
 
159
     * by the host) should be implemented in the host version of
-
 
160
     * AcpiOsValidateInterface and should not be added here.
-
 
161
     */
-
 
162
};
-
 
163
 
-
 
164
 
-
 
165
/*******************************************************************************
-
 
166
 *
-
 
167
 * FUNCTION:    AcpiUtOsiImplementation
-
 
168
 *
-
 
169
 * PARAMETERS:  WalkState           - Current walk state
-
 
170
 *
-
 
171
 * RETURN:      Status
-
 
172
 *
-
 
173
 * DESCRIPTION: Implementation of the _OSI predefined control method
-
 
174
 *
-
 
175
 ******************************************************************************/
-
 
176
 
-
 
177
ACPI_STATUS
-
 
178
AcpiUtOsiImplementation (
-
 
179
    ACPI_WALK_STATE         *WalkState)
-
 
180
{
-
 
181
    ACPI_STATUS             Status;
-
 
182
    ACPI_OPERAND_OBJECT     *StringDesc;
-
 
183
    ACPI_OPERAND_OBJECT     *ReturnDesc;
-
 
184
    UINT32                  ReturnValue;
-
 
185
    UINT32                  i;
-
 
186
 
-
 
187
 
-
 
188
    ACPI_FUNCTION_TRACE (UtOsiImplementation);
-
 
189
 
-
 
190
 
-
 
191
    /* Validate the string input argument */
-
 
192
 
-
 
193
    StringDesc = WalkState->Arguments[0].Object;
-
 
194
    if (!StringDesc || (StringDesc->Common.Type != ACPI_TYPE_STRING))
-
 
195
    {
-
 
196
        return_ACPI_STATUS (AE_TYPE);
-
 
197
    }
-
 
198
 
-
 
199
    /* Create a return object */
-
 
200
 
-
 
201
    ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
-
 
202
    if (!ReturnDesc)
-
 
203
    {
-
 
204
        return_ACPI_STATUS (AE_NO_MEMORY);
-
 
205
    }
-
 
206
 
-
 
207
    /* Default return value is 0, NOT SUPPORTED */
-
 
208
 
-
 
209
    ReturnValue = 0;
-
 
210
 
-
 
211
    /* Compare input string to static table of supported interfaces */
-
 
212
 
-
 
213
    for (i = 0; i < ACPI_ARRAY_LENGTH (AcpiInterfacesSupported); i++)
-
 
214
    {
-
 
215
        if (!ACPI_STRCMP (StringDesc->String.Pointer,
-
 
216
                AcpiInterfacesSupported[i].Name))
-
 
217
        {
-
 
218
            /*
-
 
219
             * The interface is supported.
-
 
220
             * Update the OsiData if necessary. We keep track of the latest
-
 
221
             * version of Windows that has been requested by the BIOS.
-
 
222
             */
-
 
223
            if (AcpiInterfacesSupported[i].Value > AcpiGbl_OsiData)
-
 
224
            {
-
 
225
                AcpiGbl_OsiData = AcpiInterfacesSupported[i].Value;
-
 
226
            }
-
 
227
 
-
 
228
            ReturnValue = ACPI_UINT32_MAX;
-
 
229
            goto Exit;
-
 
230
        }
-
 
231
    }
-
 
232
 
-
 
233
    /*
-
 
234
     * Did not match the string in the static table, call the host OSL to
-
 
235
     * check for a match with one of the optional strings (such as
-
 
236
     * "Module Device", "3.0 Thermal Model", etc.)
-
 
237
     */
-
 
238
    Status = AcpiOsValidateInterface (StringDesc->String.Pointer);
-
 
239
    if (ACPI_SUCCESS (Status))
-
 
240
    {
-
 
241
        /* The interface is supported */
-
 
242
 
-
 
243
        ReturnValue = ACPI_UINT32_MAX;
-
 
244
    }
-
 
245
 
-
 
246
 
-
 
247
Exit:
-
 
248
    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
-
 
249
        "ACPI: BIOS _OSI(%s) is %ssupported\n",
-
 
250
        StringDesc->String.Pointer, ReturnValue == 0 ? "not " : ""));
-
 
251
 
-
 
252
    /* Complete the return value */
-
 
253
 
-
 
254
    ReturnDesc->Integer.Value = ReturnValue;
-
 
255
    WalkState->ReturnDesc = ReturnDesc;
-
 
256
    return_ACPI_STATUS (AE_OK);
-
 
257
}
124
        ACPI_MODULE_NAME    ("uteval")
258
 
125
 
259
 
126
 
260
/*******************************************************************************
127
/*******************************************************************************
261
 *
128
 *