xref: /netbsd-src/sys/external/bsd/acpica/dist/common/ahuuids.c (revision 046a29855e04359424fd074e8313af6b6be8cfb6)
1460301d4Schristos /******************************************************************************
2460301d4Schristos  *
3460301d4Schristos  * Module Name: ahuuids - Table of known ACPI-related UUIDs
4460301d4Schristos  *
5460301d4Schristos  *****************************************************************************/
6460301d4Schristos 
7460301d4Schristos /*
8*046a2985Schristos  * Copyright (C) 2000 - 2023, Intel Corp.
9460301d4Schristos  * All rights reserved.
10460301d4Schristos  *
11460301d4Schristos  * Redistribution and use in source and binary forms, with or without
12460301d4Schristos  * modification, are permitted provided that the following conditions
13460301d4Schristos  * are met:
14460301d4Schristos  * 1. Redistributions of source code must retain the above copyright
15460301d4Schristos  *    notice, this list of conditions, and the following disclaimer,
16460301d4Schristos  *    without modification.
17460301d4Schristos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18460301d4Schristos  *    substantially similar to the "NO WARRANTY" disclaimer below
19460301d4Schristos  *    ("Disclaimer") and any redistribution must be conditioned upon
20460301d4Schristos  *    including a substantially similar Disclaimer requirement for further
21460301d4Schristos  *    binary redistribution.
22460301d4Schristos  * 3. Neither the names of the above-listed copyright holders nor the names
23460301d4Schristos  *    of any contributors may be used to endorse or promote products derived
24460301d4Schristos  *    from this software without specific prior written permission.
25460301d4Schristos  *
26460301d4Schristos  * Alternatively, this software may be distributed under the terms of the
27460301d4Schristos  * GNU General Public License ("GPL") version 2 as published by the Free
28460301d4Schristos  * Software Foundation.
29460301d4Schristos  *
30460301d4Schristos  * NO WARRANTY
31460301d4Schristos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32460301d4Schristos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3346a330b4Schristos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34460301d4Schristos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35460301d4Schristos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36460301d4Schristos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37460301d4Schristos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38460301d4Schristos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39460301d4Schristos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40460301d4Schristos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41460301d4Schristos  * POSSIBILITY OF SUCH DAMAGES.
42460301d4Schristos  */
43460301d4Schristos 
44460301d4Schristos #include "acpi.h"
45460301d4Schristos #include "accommon.h"
46c72da027Schristos #include "acuuid.h"
47460301d4Schristos 
48460301d4Schristos #define _COMPONENT          ACPI_UTILITIES
49460301d4Schristos         ACPI_MODULE_NAME    ("ahuuids")
50460301d4Schristos 
5171e38f1dSchristos 
52460301d4Schristos /*
53460301d4Schristos  * Table of "known" (ACPI-related) UUIDs
54460301d4Schristos  */
550b89cdedSchristos const AH_UUID  Gbl_AcpiUuids[] =
56460301d4Schristos {
57c72da027Schristos     {"[Controllers]",               NULL},
58c72da027Schristos     {"GPIO Controller",             UUID_GPIO_CONTROLLER},
59c72da027Schristos     {"USB Controller",              UUID_USB_CONTROLLER},
60c72da027Schristos     {"SATA Controller",             UUID_SATA_CONTROLLER},
61460301d4Schristos 
62c72da027Schristos     {"[Devices]",                   NULL},
63c72da027Schristos     {"PCI Host Bridge Device",      UUID_PCI_HOST_BRIDGE},
64c72da027Schristos     {"HID I2C Device",              UUID_I2C_DEVICE},
65c72da027Schristos     {"Power Button Device",         UUID_POWER_BUTTON},
66360a9019Schristos     {"Memory Device",               UUID_MEMORY_DEVICE},
67360a9019Schristos     {"Generic Buttons Device",      UUID_GENERIC_BUTTONS_DEVICE},
68360a9019Schristos     {"NVDIMM Root Device",          UUID_NVDIMM_ROOT_DEVICE},
69360a9019Schristos     {"Control Method Battery",      UUID_CONTROL_METHOD_BATTERY},
70460301d4Schristos 
71c72da027Schristos     {"[Interfaces]",                NULL},
72c72da027Schristos     {"Device Labeling Interface",   UUID_DEVICE_LABELING},
73c72da027Schristos     {"Physical Presence Interface", UUID_PHYSICAL_PRESENCE},
74460301d4Schristos 
75c72da027Schristos     {"[Non-volatile DIMM and NFIT table]",       NULL},
76360a9019Schristos     {"NVDIMM Device",               UUID_NFIT_DIMM},
77c72da027Schristos     {"Volatile Memory Region",      UUID_VOLATILE_MEMORY},
78c72da027Schristos     {"Persistent Memory Region",    UUID_PERSISTENT_MEMORY},
79c72da027Schristos     {"NVDIMM Control Region",       UUID_CONTROL_REGION},
80c72da027Schristos     {"NVDIMM Data Region",          UUID_DATA_REGION},
81c72da027Schristos     {"Volatile Virtual Disk",       UUID_VOLATILE_VIRTUAL_DISK},
82c72da027Schristos     {"Volatile Virtual CD",         UUID_VOLATILE_VIRTUAL_CD},
83c72da027Schristos     {"Persistent Virtual Disk",     UUID_PERSISTENT_VIRTUAL_DISK},
84c72da027Schristos     {"Persistent Virtual CD",       UUID_PERSISTENT_VIRTUAL_CD},
85360a9019Schristos     {"Microsoft NVDIMM Command set",UUID_NFIT_DIMM_N_MSFT},
86360a9019Schristos     {"HP NDIMM HPE1",               UUID_NFIT_DIMM_N_HPE1},
87360a9019Schristos     {"HP NDIMM HPE2",               UUID_NFIT_DIMM_N_HPE2},
88360a9019Schristos     {"Virtual NVDIMM",              UUID_NFIT_DIMM_N_HYPERV},
89460301d4Schristos 
9089b8eb6cSchristos     {"[Processor Properties]",      NULL},
9189b8eb6cSchristos     {"Cache Properties",            UUID_CACHE_PROPERTIES},
9289b8eb6cSchristos     {"Physical Package Property",   UUID_PHYSICAL_PROPERTY},
9389b8eb6cSchristos 
94c72da027Schristos     {"[Miscellaneous]",             NULL},
95c72da027Schristos     {"Platform-wide Capabilities",  UUID_PLATFORM_CAPABILITIES},
96c72da027Schristos     {"Dynamic Enumeration",         UUID_DYNAMIC_ENUMERATION},
97c72da027Schristos     {"Battery Thermal Limit",       UUID_BATTERY_THERMAL_LIMIT},
98c72da027Schristos     {"Thermal Extensions",          UUID_THERMAL_EXTENSIONS},
99c72da027Schristos     {"Device Properties for _DSD",  UUID_DEVICE_PROPERTIES},
100360a9019Schristos     {"Device Graphs for _DSD",      UUID_DEVICE_GRAPHS},
101360a9019Schristos     {"Hierarchical Data Extension", UUID_HIERARCHICAL_DATA_EXTENSION},
102360a9019Schristos     {"ARM Coresight Graph",         UUID_CORESIGHT_GRAPH},
10346a330b4Schristos     {"USB4 Capabilities",           UUID_USB4_CAPABILITIES},
10482065f3bSchristos     {"First Function ID for _DSM",  UUID_1ST_FUNCTION_ID},
10582065f3bSchristos     {"Second Function ID for _DSM", UUID_2ND_FUNCTION_ID},
10682065f3bSchristos 
107460301d4Schristos     {NULL, NULL}
108460301d4Schristos };
109460301d4Schristos 
110460301d4Schristos 
111460301d4Schristos /*******************************************************************************
112460301d4Schristos  *
113460301d4Schristos  * FUNCTION:    AcpiAhMatchUuid
114460301d4Schristos  *
115460301d4Schristos  * PARAMETERS:  Data                - Data buffer containing a UUID
116460301d4Schristos  *
117460301d4Schristos  * RETURN:      ASCII description string for the UUID if it is found.
118460301d4Schristos  *
119460301d4Schristos  * DESCRIPTION: Returns a description string for "known" UUIDs, which are
120460301d4Schristos  *              are UUIDs that are related to ACPI in some way.
121460301d4Schristos  *
122460301d4Schristos  ******************************************************************************/
123460301d4Schristos 
124460301d4Schristos const char *
AcpiAhMatchUuid(UINT8 * Data)125460301d4Schristos AcpiAhMatchUuid (
126460301d4Schristos     UINT8                   *Data)
127460301d4Schristos {
128460301d4Schristos     const AH_UUID           *Info;
129460301d4Schristos     UINT8                   UuidBuffer[UUID_BUFFER_LENGTH];
130460301d4Schristos 
131460301d4Schristos 
132460301d4Schristos     /* Walk the table of known ACPI-related UUIDs */
133460301d4Schristos 
1340b89cdedSchristos     for (Info = Gbl_AcpiUuids; Info->Description; Info++)
135460301d4Schristos     {
13694783addSchristos         /* Null string means description is a UUID class */
137c72da027Schristos 
138c72da027Schristos         if (!Info->String)
139c72da027Schristos         {
140c72da027Schristos             continue;
141c72da027Schristos         }
142c72da027Schristos 
143460301d4Schristos         AcpiUtConvertStringToUuid (Info->String, UuidBuffer);
144460301d4Schristos 
145c72da027Schristos         if (!memcmp (Data, UuidBuffer, UUID_BUFFER_LENGTH))
146460301d4Schristos         {
147460301d4Schristos             return (Info->Description);
148460301d4Schristos         }
149460301d4Schristos     }
150460301d4Schristos 
151460301d4Schristos     return (NULL);
152460301d4Schristos }
153