Path: blob/main/sys/contrib/dev/acpica/components/events/evgpeblk.c
48526 views
/******************************************************************************1*2* Module Name: evgpeblk - GPE block creation and initialization.3*4*****************************************************************************/56/******************************************************************************7*8* 1. Copyright Notice9*10* Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.11* All rights reserved.12*13* 2. License14*15* 2.1. This is your license from Intel Corp. under its intellectual property16* rights. You may have additional license terms from the party that provided17* you this software, covering your right to use that party's intellectual18* property rights.19*20* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a21* copy of the source code appearing in this file ("Covered Code") an22* irrevocable, perpetual, worldwide license under Intel's copyrights in the23* base code distributed originally by Intel ("Original Intel Code") to copy,24* make derivatives, distribute, use and display any portion of the Covered25* Code in any form, with the right to sublicense such rights; and26*27* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent28* license (with the right to sublicense), under only those claims of Intel29* patents that are infringed by the Original Intel Code, to make, use, sell,30* offer to sell, and import the Covered Code and derivative works thereof31* solely to the minimum extent necessary to exercise the above copyright32* license, and in no event shall the patent license extend to any additions33* to or modifications of the Original Intel Code. No other license or right34* is granted directly or by implication, estoppel or otherwise;35*36* The above copyright and patent license is granted only if the following37* conditions are met:38*39* 3. Conditions40*41* 3.1. Redistribution of Source with Rights to Further Distribute Source.42* Redistribution of source code of any substantial portion of the Covered43* Code or modification with rights to further distribute source must include44* the above Copyright Notice, the above License, this list of Conditions,45* and the following Disclaimer and Export Compliance provision. In addition,46* Licensee must cause all Covered Code to which Licensee contributes to47* contain a file documenting the changes Licensee made to create that Covered48* Code and the date of any change. Licensee must include in that file the49* documentation of any changes made by any predecessor Licensee. Licensee50* must include a prominent statement that the modification is derived,51* directly or indirectly, from Original Intel Code.52*53* 3.2. Redistribution of Source with no Rights to Further Distribute Source.54* Redistribution of source code of any substantial portion of the Covered55* Code or modification without rights to further distribute source must56* include the following Disclaimer and Export Compliance provision in the57* documentation and/or other materials provided with distribution. In58* addition, Licensee may not authorize further sublicense of source of any59* portion of the Covered Code, and must include terms to the effect that the60* license from Licensee to its licensee is limited to the intellectual61* property embodied in the software Licensee provides to its licensee, and62* not to intellectual property embodied in modifications its licensee may63* make.64*65* 3.3. Redistribution of Executable. Redistribution in executable form of any66* substantial portion of the Covered Code or modification must reproduce the67* above Copyright Notice, and the following Disclaimer and Export Compliance68* provision in the documentation and/or other materials provided with the69* distribution.70*71* 3.4. Intel retains all right, title, and interest in and to the Original72* Intel Code.73*74* 3.5. Neither the name Intel nor any other trademark owned or controlled by75* Intel shall be used in advertising or otherwise to promote the sale, use or76* other dealings in products derived from or relating to the Covered Code77* without prior written authorization from Intel.78*79* 4. Disclaimer and Export Compliance80*81* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED82* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE83* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,84* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY85* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY86* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A87* PARTICULAR PURPOSE.88*89* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES90* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR91* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,92* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY93* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL94* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS95* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY96* LIMITED REMEDY.97*98* 4.3. Licensee shall not export, either directly or indirectly, any of this99* software or system incorporating such software without first obtaining any100* required license or other approval from the U. S. Department of Commerce or101* any other agency or department of the United States Government. In the102* event Licensee exports any such software from the United States or103* re-exports any such software from a foreign destination, Licensee shall104* ensure that the distribution and export/re-export of the software is in105* compliance with all laws, regulations, orders, or other restrictions of the106* U.S. Export Administration Regulations. Licensee agrees that neither it nor107* any of its subsidiaries will export/re-export any technical data, process,108* software, or service, directly or indirectly, to any country for which the109* United States government or any agency thereof requires an export license,110* other governmental approval, or letter of assurance, without first obtaining111* such license, approval or letter.112*113*****************************************************************************114*115* Alternatively, you may choose to be licensed under the terms of the116* following license:117*118* Redistribution and use in source and binary forms, with or without119* modification, are permitted provided that the following conditions120* are met:121* 1. Redistributions of source code must retain the above copyright122* notice, this list of conditions, and the following disclaimer,123* without modification.124* 2. Redistributions in binary form must reproduce at minimum a disclaimer125* substantially similar to the "NO WARRANTY" disclaimer below126* ("Disclaimer") and any redistribution must be conditioned upon127* including a substantially similar Disclaimer requirement for further128* binary redistribution.129* 3. Neither the names of the above-listed copyright holders nor the names130* of any contributors may be used to endorse or promote products derived131* from this software without specific prior written permission.132*133* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS134* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT135* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR136* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT137* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,138* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT139* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,140* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY141* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT142* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE143* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.144*145* Alternatively, you may choose to be licensed under the terms of the146* GNU General Public License ("GPL") version 2 as published by the Free147* Software Foundation.148*149*****************************************************************************/150151#include <contrib/dev/acpica/include/acpi.h>152#include <contrib/dev/acpica/include/accommon.h>153#include <contrib/dev/acpica/include/acevents.h>154#include <contrib/dev/acpica/include/acnamesp.h>155156#define _COMPONENT ACPI_EVENTS157ACPI_MODULE_NAME ("evgpeblk")158159#if (!ACPI_REDUCED_HARDWARE) /* Entire module */160161/* Local prototypes */162163static ACPI_STATUS164AcpiEvInstallGpeBlock (165ACPI_GPE_BLOCK_INFO *GpeBlock,166UINT32 InterruptNumber);167168static ACPI_STATUS169AcpiEvCreateGpeInfoBlocks (170ACPI_GPE_BLOCK_INFO *GpeBlock);171172173/*******************************************************************************174*175* FUNCTION: AcpiEvInstallGpeBlock176*177* PARAMETERS: GpeBlock - New GPE block178* InterruptNumber - Xrupt to be associated with this179* GPE block180*181* RETURN: Status182*183* DESCRIPTION: Install new GPE block with mutex support184*185******************************************************************************/186187static ACPI_STATUS188AcpiEvInstallGpeBlock (189ACPI_GPE_BLOCK_INFO *GpeBlock,190UINT32 InterruptNumber)191{192ACPI_GPE_BLOCK_INFO *NextGpeBlock;193ACPI_GPE_XRUPT_INFO *GpeXruptBlock;194ACPI_STATUS Status;195ACPI_CPU_FLAGS Flags;196197198ACPI_FUNCTION_TRACE (EvInstallGpeBlock);199200201Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);202if (ACPI_FAILURE (Status))203{204return_ACPI_STATUS (Status);205}206207Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock);208if (ACPI_FAILURE (Status))209{210goto UnlockAndExit;211}212213/* Install the new block at the end of the list with lock */214215Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);216if (GpeXruptBlock->GpeBlockListHead)217{218NextGpeBlock = GpeXruptBlock->GpeBlockListHead;219while (NextGpeBlock->Next)220{221NextGpeBlock = NextGpeBlock->Next;222}223224NextGpeBlock->Next = GpeBlock;225GpeBlock->Previous = NextGpeBlock;226}227else228{229GpeXruptBlock->GpeBlockListHead = GpeBlock;230}231232GpeBlock->XruptBlock = GpeXruptBlock;233AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);234235236UnlockAndExit:237(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);238return_ACPI_STATUS (Status);239}240241242/*******************************************************************************243*244* FUNCTION: AcpiEvDeleteGpeBlock245*246* PARAMETERS: GpeBlock - Existing GPE block247*248* RETURN: Status249*250* DESCRIPTION: Remove a GPE block251*252******************************************************************************/253254ACPI_STATUS255AcpiEvDeleteGpeBlock (256ACPI_GPE_BLOCK_INFO *GpeBlock)257{258ACPI_STATUS Status;259ACPI_CPU_FLAGS Flags;260261262ACPI_FUNCTION_TRACE (EvInstallGpeBlock);263264265Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);266if (ACPI_FAILURE (Status))267{268return_ACPI_STATUS (Status);269}270271/* Disable all GPEs in this block */272273Status = AcpiHwDisableGpeBlock (GpeBlock->XruptBlock, GpeBlock, NULL);274if (ACPI_FAILURE (Status))275{276return_ACPI_STATUS (Status);277}278279if (!GpeBlock->Previous && !GpeBlock->Next)280{281/* This is the last GpeBlock on this interrupt */282283Status = AcpiEvDeleteGpeXrupt (GpeBlock->XruptBlock);284if (ACPI_FAILURE (Status))285{286goto UnlockAndExit;287}288}289else290{291/* Remove the block on this interrupt with lock */292293Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);294if (GpeBlock->Previous)295{296GpeBlock->Previous->Next = GpeBlock->Next;297}298else299{300GpeBlock->XruptBlock->GpeBlockListHead = GpeBlock->Next;301}302303if (GpeBlock->Next)304{305GpeBlock->Next->Previous = GpeBlock->Previous;306}307308AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);309}310311AcpiCurrentGpeCount -= GpeBlock->GpeCount;312313/* Free the GpeBlock */314315ACPI_FREE (GpeBlock->RegisterInfo);316ACPI_FREE (GpeBlock->EventInfo);317ACPI_FREE (GpeBlock);318319UnlockAndExit:320Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);321return_ACPI_STATUS (Status);322}323324325/*******************************************************************************326*327* FUNCTION: AcpiEvCreateGpeInfoBlocks328*329* PARAMETERS: GpeBlock - New GPE block330*331* RETURN: Status332*333* DESCRIPTION: Create the RegisterInfo and EventInfo blocks for this GPE block334*335******************************************************************************/336337static ACPI_STATUS338AcpiEvCreateGpeInfoBlocks (339ACPI_GPE_BLOCK_INFO *GpeBlock)340{341ACPI_GPE_REGISTER_INFO *GpeRegisterInfo = NULL;342ACPI_GPE_EVENT_INFO *GpeEventInfo = NULL;343ACPI_GPE_EVENT_INFO *ThisEvent;344ACPI_GPE_REGISTER_INFO *ThisRegister;345UINT32 i;346UINT32 j;347ACPI_STATUS Status;348349350ACPI_FUNCTION_TRACE (EvCreateGpeInfoBlocks);351352353/* Allocate the GPE register information block */354355GpeRegisterInfo = ACPI_ALLOCATE_ZEROED (356(ACPI_SIZE) GpeBlock->RegisterCount *357sizeof (ACPI_GPE_REGISTER_INFO));358if (!GpeRegisterInfo)359{360ACPI_ERROR ((AE_INFO,361"Could not allocate the GpeRegisterInfo table"));362return_ACPI_STATUS (AE_NO_MEMORY);363}364365/*366* Allocate the GPE EventInfo block. There are eight distinct GPEs367* per register. Initialization to zeros is sufficient.368*/369GpeEventInfo = ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) GpeBlock->GpeCount *370sizeof (ACPI_GPE_EVENT_INFO));371if (!GpeEventInfo)372{373ACPI_ERROR ((AE_INFO,374"Could not allocate the GpeEventInfo table"));375Status = AE_NO_MEMORY;376goto ErrorExit;377}378379/* Save the new Info arrays in the GPE block */380381GpeBlock->RegisterInfo = GpeRegisterInfo;382GpeBlock->EventInfo = GpeEventInfo;383384/*385* Initialize the GPE Register and Event structures. A goal of these386* tables is to hide the fact that there are two separate GPE register387* sets in a given GPE hardware block, the status registers occupy the388* first half, and the enable registers occupy the second half.389*/390ThisRegister = GpeRegisterInfo;391ThisEvent = GpeEventInfo;392393for (i = 0; i < GpeBlock->RegisterCount; i++)394{395/* Init the RegisterInfo for this GPE register (8 GPEs) */396397ThisRegister->BaseGpeNumber = (UINT16)398(GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));399400ThisRegister->StatusAddress.Address =401GpeBlock->Address + i;402403ThisRegister->EnableAddress.Address =404GpeBlock->Address + i + GpeBlock->RegisterCount;405406ThisRegister->StatusAddress.SpaceId = GpeBlock->SpaceId;407ThisRegister->EnableAddress.SpaceId = GpeBlock->SpaceId;408ThisRegister->StatusAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;409ThisRegister->EnableAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;410ThisRegister->StatusAddress.BitOffset = 0;411ThisRegister->EnableAddress.BitOffset = 0;412413/* Init the EventInfo for each GPE within this register */414415for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)416{417ThisEvent->GpeNumber = (UINT8) (ThisRegister->BaseGpeNumber + j);418ThisEvent->RegisterInfo = ThisRegister;419ThisEvent++;420}421422/* Disable all GPEs within this register */423424Status = AcpiHwWrite (0x00, &ThisRegister->EnableAddress);425if (ACPI_FAILURE (Status))426{427goto ErrorExit;428}429430/* Clear any pending GPE events within this register */431432Status = AcpiHwWrite (0xFF, &ThisRegister->StatusAddress);433if (ACPI_FAILURE (Status))434{435goto ErrorExit;436}437438ThisRegister++;439}440441return_ACPI_STATUS (AE_OK);442443444ErrorExit:445if (GpeRegisterInfo)446{447ACPI_FREE (GpeRegisterInfo);448}449if (GpeEventInfo)450{451ACPI_FREE (GpeEventInfo);452}453454return_ACPI_STATUS (Status);455}456457458/*******************************************************************************459*460* FUNCTION: AcpiEvCreateGpeBlock461*462* PARAMETERS: GpeDevice - Handle to the parent GPE block463* GpeBlockAddress - Address and SpaceID464* RegisterCount - Number of GPE register pairs in the block465* GpeBlockBaseNumber - Starting GPE number for the block466* InterruptNumber - H/W interrupt for the block467* ReturnGpeBlock - Where the new block descriptor is returned468*469* RETURN: Status470*471* DESCRIPTION: Create and Install a block of GPE registers. All GPEs within472* the block are disabled at exit.473* Note: Assumes namespace is locked.474*475******************************************************************************/476477ACPI_STATUS478AcpiEvCreateGpeBlock (479ACPI_NAMESPACE_NODE *GpeDevice,480UINT64 Address,481UINT8 SpaceId,482UINT32 RegisterCount,483UINT16 GpeBlockBaseNumber,484UINT32 InterruptNumber,485ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)486{487ACPI_STATUS Status;488ACPI_GPE_BLOCK_INFO *GpeBlock;489ACPI_GPE_WALK_INFO WalkInfo;490491492ACPI_FUNCTION_TRACE (EvCreateGpeBlock);493494495if (!RegisterCount)496{497return_ACPI_STATUS (AE_OK);498}499500/* Allocate a new GPE block */501502GpeBlock = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_BLOCK_INFO));503if (!GpeBlock)504{505return_ACPI_STATUS (AE_NO_MEMORY);506}507508/* Initialize the new GPE block */509510GpeBlock->Address = Address;511GpeBlock->SpaceId = SpaceId;512GpeBlock->Node = GpeDevice;513GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);514GpeBlock->Initialized = FALSE;515GpeBlock->RegisterCount = RegisterCount;516GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;517518/*519* Create the RegisterInfo and EventInfo sub-structures520* Note: disables and clears all GPEs in the block521*/522Status = AcpiEvCreateGpeInfoBlocks (GpeBlock);523if (ACPI_FAILURE (Status))524{525ACPI_FREE (GpeBlock);526return_ACPI_STATUS (Status);527}528529/* Install the new block in the global lists */530531Status = AcpiEvInstallGpeBlock (GpeBlock, InterruptNumber);532if (ACPI_FAILURE (Status))533{534ACPI_FREE (GpeBlock->RegisterInfo);535ACPI_FREE (GpeBlock->EventInfo);536ACPI_FREE (GpeBlock);537return_ACPI_STATUS (Status);538}539540AcpiGbl_AllGpesInitialized = FALSE;541542/* Find all GPE methods (_Lxx or_Exx) for this block */543544WalkInfo.GpeBlock = GpeBlock;545WalkInfo.GpeDevice = GpeDevice;546WalkInfo.ExecuteByOwnerId = FALSE;547548(void) AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,549ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,550AcpiEvMatchGpeMethod, NULL, &WalkInfo, NULL);551552/* Return the new block */553554if (ReturnGpeBlock)555{556(*ReturnGpeBlock) = GpeBlock;557}558559ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,560" Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",561(UINT32) GpeBlock->BlockBaseNumber,562(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),563GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,564InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));565566/* Update global count of currently available GPEs */567568AcpiCurrentGpeCount += GpeBlock->GpeCount;569return_ACPI_STATUS (AE_OK);570}571572573/*******************************************************************************574*575* FUNCTION: AcpiEvInitializeGpeBlock576*577* PARAMETERS: ACPI_GPE_CALLBACK578*579* RETURN: Status580*581* DESCRIPTION: Initialize and enable a GPE block. Enable GPEs that have582* associated methods.583* Note: Assumes namespace is locked.584*585******************************************************************************/586587ACPI_STATUS588AcpiEvInitializeGpeBlock (589ACPI_GPE_XRUPT_INFO *GpeXruptInfo,590ACPI_GPE_BLOCK_INFO *GpeBlock,591void *Context)592{593ACPI_STATUS Status;594ACPI_GPE_EVENT_INFO *GpeEventInfo;595UINT32 GpeEnabledCount;596UINT32 GpeIndex;597UINT32 i;598UINT32 j;599BOOLEAN *IsPollingNeeded = Context;600ACPI_ERROR_ONLY (UINT32 GpeNumber);601602603ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);604605606/*607* Ignore a null GPE block (e.g., if no GPE block 1 exists), and608* any GPE blocks that have been initialized already.609*/610if (!GpeBlock || GpeBlock->Initialized)611{612return_ACPI_STATUS (AE_OK);613}614615/*616* Enable all GPEs that have a corresponding method and have the617* ACPI_GPE_CAN_WAKE flag unset. Any other GPEs within this block618* must be enabled via the acpi_enable_gpe() interface.619*/620GpeEnabledCount = 0;621622for (i = 0; i < GpeBlock->RegisterCount; i++)623{624for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)625{626/* Get the info block for this particular GPE */627628GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;629GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];630ACPI_ERROR_ONLY(GpeNumber = GpeBlock->BlockBaseNumber + GpeIndex);631GpeEventInfo->Flags |= ACPI_GPE_INITIALIZED;632633/*634* Ignore GPEs that have no corresponding _Lxx/_Exx method635* and GPEs that are used to wake the system636*/637if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) != ACPI_GPE_DISPATCH_METHOD) ||638(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))639{640continue;641}642643Status = AcpiEvAddGpeReference (GpeEventInfo, FALSE);644if (ACPI_FAILURE (Status))645{646ACPI_EXCEPTION ((AE_INFO, Status,647"Could not enable GPE 0x%02X",648GpeNumber));649continue;650}651652GpeEventInfo->Flags |= ACPI_GPE_AUTO_ENABLED;653654if (IsPollingNeeded &&655ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))656{657*IsPollingNeeded = TRUE;658}659660GpeEnabledCount++;661}662}663664if (GpeEnabledCount)665{666ACPI_INFO ((667"Enabled %u GPEs in block %02X to %02X", GpeEnabledCount,668(UINT32) GpeBlock->BlockBaseNumber,669(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1))));670}671672GpeBlock->Initialized = TRUE;673return_ACPI_STATUS (AE_OK);674}675676#endif /* !ACPI_REDUCED_HARDWARE */677678679