1271440Sjkim/******************************************************************************
2271440Sjkim *
3271440Sjkim * Module Name: ahuuids - Table of known ACPI-related UUIDs
4271440Sjkim *
5271440Sjkim *****************************************************************************/
6271440Sjkim
7316303Sjkim/******************************************************************************
8316303Sjkim *
9316303Sjkim * 1. Copyright Notice
10316303Sjkim *
11316303Sjkim * Some or all of this work - Copyright (c) 1999 - 2017, Intel Corp.
12271440Sjkim * All rights reserved.
13271440Sjkim *
14316303Sjkim * 2. License
15316303Sjkim *
16316303Sjkim * 2.1. This is your license from Intel Corp. under its intellectual property
17316303Sjkim * rights. You may have additional license terms from the party that provided
18316303Sjkim * you this software, covering your right to use that party's intellectual
19316303Sjkim * property rights.
20316303Sjkim *
21316303Sjkim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22316303Sjkim * copy of the source code appearing in this file ("Covered Code") an
23316303Sjkim * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24316303Sjkim * base code distributed originally by Intel ("Original Intel Code") to copy,
25316303Sjkim * make derivatives, distribute, use and display any portion of the Covered
26316303Sjkim * Code in any form, with the right to sublicense such rights; and
27316303Sjkim *
28316303Sjkim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29316303Sjkim * license (with the right to sublicense), under only those claims of Intel
30316303Sjkim * patents that are infringed by the Original Intel Code, to make, use, sell,
31316303Sjkim * offer to sell, and import the Covered Code and derivative works thereof
32316303Sjkim * solely to the minimum extent necessary to exercise the above copyright
33316303Sjkim * license, and in no event shall the patent license extend to any additions
34316303Sjkim * to or modifications of the Original Intel Code. No other license or right
35316303Sjkim * is granted directly or by implication, estoppel or otherwise;
36316303Sjkim *
37316303Sjkim * The above copyright and patent license is granted only if the following
38316303Sjkim * conditions are met:
39316303Sjkim *
40316303Sjkim * 3. Conditions
41316303Sjkim *
42316303Sjkim * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43316303Sjkim * Redistribution of source code of any substantial portion of the Covered
44316303Sjkim * Code or modification with rights to further distribute source must include
45316303Sjkim * the above Copyright Notice, the above License, this list of Conditions,
46316303Sjkim * and the following Disclaimer and Export Compliance provision. In addition,
47316303Sjkim * Licensee must cause all Covered Code to which Licensee contributes to
48316303Sjkim * contain a file documenting the changes Licensee made to create that Covered
49316303Sjkim * Code and the date of any change. Licensee must include in that file the
50316303Sjkim * documentation of any changes made by any predecessor Licensee. Licensee
51316303Sjkim * must include a prominent statement that the modification is derived,
52316303Sjkim * directly or indirectly, from Original Intel Code.
53316303Sjkim *
54316303Sjkim * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55316303Sjkim * Redistribution of source code of any substantial portion of the Covered
56316303Sjkim * Code or modification without rights to further distribute source must
57316303Sjkim * include the following Disclaimer and Export Compliance provision in the
58316303Sjkim * documentation and/or other materials provided with distribution. In
59316303Sjkim * addition, Licensee may not authorize further sublicense of source of any
60316303Sjkim * portion of the Covered Code, and must include terms to the effect that the
61316303Sjkim * license from Licensee to its licensee is limited to the intellectual
62316303Sjkim * property embodied in the software Licensee provides to its licensee, and
63316303Sjkim * not to intellectual property embodied in modifications its licensee may
64316303Sjkim * make.
65316303Sjkim *
66316303Sjkim * 3.3. Redistribution of Executable. Redistribution in executable form of any
67316303Sjkim * substantial portion of the Covered Code or modification must reproduce the
68316303Sjkim * above Copyright Notice, and the following Disclaimer and Export Compliance
69316303Sjkim * provision in the documentation and/or other materials provided with the
70316303Sjkim * distribution.
71316303Sjkim *
72316303Sjkim * 3.4. Intel retains all right, title, and interest in and to the Original
73316303Sjkim * Intel Code.
74316303Sjkim *
75316303Sjkim * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76316303Sjkim * Intel shall be used in advertising or otherwise to promote the sale, use or
77316303Sjkim * other dealings in products derived from or relating to the Covered Code
78316303Sjkim * without prior written authorization from Intel.
79316303Sjkim *
80316303Sjkim * 4. Disclaimer and Export Compliance
81316303Sjkim *
82316303Sjkim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83316303Sjkim * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84316303Sjkim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85316303Sjkim * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86316303Sjkim * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87316303Sjkim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88316303Sjkim * PARTICULAR PURPOSE.
89316303Sjkim *
90316303Sjkim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91316303Sjkim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92316303Sjkim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93316303Sjkim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94316303Sjkim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95316303Sjkim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96316303Sjkim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97316303Sjkim * LIMITED REMEDY.
98316303Sjkim *
99316303Sjkim * 4.3. Licensee shall not export, either directly or indirectly, any of this
100316303Sjkim * software or system incorporating such software without first obtaining any
101316303Sjkim * required license or other approval from the U. S. Department of Commerce or
102316303Sjkim * any other agency or department of the United States Government. In the
103316303Sjkim * event Licensee exports any such software from the United States or
104316303Sjkim * re-exports any such software from a foreign destination, Licensee shall
105316303Sjkim * ensure that the distribution and export/re-export of the software is in
106316303Sjkim * compliance with all laws, regulations, orders, or other restrictions of the
107316303Sjkim * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108316303Sjkim * any of its subsidiaries will export/re-export any technical data, process,
109316303Sjkim * software, or service, directly or indirectly, to any country for which the
110316303Sjkim * United States government or any agency thereof requires an export license,
111316303Sjkim * other governmental approval, or letter of assurance, without first obtaining
112316303Sjkim * such license, approval or letter.
113316303Sjkim *
114316303Sjkim *****************************************************************************
115316303Sjkim *
116316303Sjkim * Alternatively, you may choose to be licensed under the terms of the
117316303Sjkim * following license:
118316303Sjkim *
119271440Sjkim * Redistribution and use in source and binary forms, with or without
120271440Sjkim * modification, are permitted provided that the following conditions
121271440Sjkim * are met:
122271440Sjkim * 1. Redistributions of source code must retain the above copyright
123271440Sjkim *    notice, this list of conditions, and the following disclaimer,
124271440Sjkim *    without modification.
125271440Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126271440Sjkim *    substantially similar to the "NO WARRANTY" disclaimer below
127271440Sjkim *    ("Disclaimer") and any redistribution must be conditioned upon
128271440Sjkim *    including a substantially similar Disclaimer requirement for further
129271440Sjkim *    binary redistribution.
130271440Sjkim * 3. Neither the names of the above-listed copyright holders nor the names
131271440Sjkim *    of any contributors may be used to endorse or promote products derived
132271440Sjkim *    from this software without specific prior written permission.
133271440Sjkim *
134316303Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135316303Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136316303Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137316303Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138316303Sjkim * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139316303Sjkim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140316303Sjkim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141316303Sjkim * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142316303Sjkim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143316303Sjkim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144316303Sjkim * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145316303Sjkim *
146316303Sjkim * Alternatively, you may choose to be licensed under the terms of the
147271440Sjkim * GNU General Public License ("GPL") version 2 as published by the Free
148271440Sjkim * Software Foundation.
149271440Sjkim *
150316303Sjkim *****************************************************************************/
151271440Sjkim
152272444Sjkim#include <contrib/dev/acpica/include/acpi.h>
153272444Sjkim#include <contrib/dev/acpica/include/accommon.h>
154283966Sjkim#include <contrib/dev/acpica/include/acuuid.h>
155271440Sjkim
156271440Sjkim#define _COMPONENT          ACPI_UTILITIES
157271440Sjkim        ACPI_MODULE_NAME    ("ahuuids")
158271440Sjkim
159298714Sjkim
160271440Sjkim/*
161271440Sjkim * Table of "known" (ACPI-related) UUIDs
162271440Sjkim */
163316303Sjkimconst AH_UUID  Gbl_AcpiUuids[] =
164271440Sjkim{
165283966Sjkim    {"[Controllers]",               NULL},
166283966Sjkim    {"GPIO Controller",             UUID_GPIO_CONTROLLER},
167283966Sjkim    {"USB Controller",              UUID_USB_CONTROLLER},
168283966Sjkim    {"SATA Controller",             UUID_SATA_CONTROLLER},
169271440Sjkim
170283966Sjkim    {"[Devices]",                   NULL},
171283966Sjkim    {"PCI Host Bridge Device",      UUID_PCI_HOST_BRIDGE},
172283966Sjkim    {"HID I2C Device",              UUID_I2C_DEVICE},
173283966Sjkim    {"Power Button Device",         UUID_POWER_BUTTON},
174271440Sjkim
175283966Sjkim    {"[Interfaces]",                NULL},
176283966Sjkim    {"Device Labeling Interface",   UUID_DEVICE_LABELING},
177283966Sjkim    {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE},
178271440Sjkim
179283966Sjkim    {"[Non-volatile DIMM and NFIT table]",       NULL},
180283966Sjkim    {"Volatile Memory Region",      UUID_VOLATILE_MEMORY},
181283966Sjkim    {"Persistent Memory Region",    UUID_PERSISTENT_MEMORY},
182283966Sjkim    {"NVDIMM Control Region",       UUID_CONTROL_REGION},
183283966Sjkim    {"NVDIMM Data Region",          UUID_DATA_REGION},
184283966Sjkim    {"Volatile Virtual Disk",       UUID_VOLATILE_VIRTUAL_DISK},
185283966Sjkim    {"Volatile Virtual CD",         UUID_VOLATILE_VIRTUAL_CD},
186283966Sjkim    {"Persistent Virtual Disk",     UUID_PERSISTENT_VIRTUAL_DISK},
187283966Sjkim    {"Persistent Virtual CD",       UUID_PERSISTENT_VIRTUAL_CD},
188271440Sjkim
189322877Sjkim    {"[Processor Properties]",      NULL},
190322877Sjkim    {"Cache Properties",            UUID_CACHE_PROPERTIES},
191322877Sjkim    {"Physical Package Property",   UUID_PHYSICAL_PROPERTY},
192322877Sjkim
193283966Sjkim    {"[Miscellaneous]",             NULL},
194283966Sjkim    {"Platform-wide Capabilities",  UUID_PLATFORM_CAPABILITIES},
195283966Sjkim    {"Dynamic Enumeration",         UUID_DYNAMIC_ENUMERATION},
196283966Sjkim    {"Battery Thermal Limit",       UUID_BATTERY_THERMAL_LIMIT},
197283966Sjkim    {"Thermal Extensions",          UUID_THERMAL_EXTENSIONS},
198283966Sjkim    {"Device Properties for _DSD",  UUID_DEVICE_PROPERTIES},
199271440Sjkim
200271440Sjkim    {NULL, NULL}
201271440Sjkim};
202271440Sjkim
203271440Sjkim
204271440Sjkim/*******************************************************************************
205271440Sjkim *
206271440Sjkim * FUNCTION:    AcpiAhMatchUuid
207271440Sjkim *
208271440Sjkim * PARAMETERS:  Data                - Data buffer containing a UUID
209271440Sjkim *
210271440Sjkim * RETURN:      ASCII description string for the UUID if it is found.
211271440Sjkim *
212271440Sjkim * DESCRIPTION: Returns a description string for "known" UUIDs, which are
213271440Sjkim *              are UUIDs that are related to ACPI in some way.
214271440Sjkim *
215271440Sjkim ******************************************************************************/
216271440Sjkim
217271440Sjkimconst char *
218271440SjkimAcpiAhMatchUuid (
219271440Sjkim    UINT8                   *Data)
220271440Sjkim{
221271440Sjkim    const AH_UUID           *Info;
222271440Sjkim    UINT8                   UuidBuffer[UUID_BUFFER_LENGTH];
223271440Sjkim
224271440Sjkim
225271440Sjkim    /* Walk the table of known ACPI-related UUIDs */
226271440Sjkim
227316303Sjkim    for (Info = Gbl_AcpiUuids; Info->Description; Info++)
228271440Sjkim    {
229283966Sjkim        /* Null string means desciption is a UUID class */
230283966Sjkim
231283966Sjkim        if (!Info->String)
232283966Sjkim        {
233283966Sjkim            continue;
234283966Sjkim        }
235283966Sjkim
236271440Sjkim        AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
237271440Sjkim
238284583Sjkim        if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH))
239271440Sjkim        {
240271440Sjkim            return (Info->Description);
241271440Sjkim        }
242271440Sjkim    }
243271440Sjkim
244271440Sjkim    return (NULL);
245271440Sjkim}
246