Path: blob/main/sys/contrib/dev/acpica/include/acnamesp.h
48287 views
/******************************************************************************1*2* Name: acnamesp.h - Namespace subcomponent prototypes and defines3*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#ifndef __ACNAMESP_H__152#define __ACNAMESP_H__153154155/* To search the entire name space, pass this as SearchBase */156157#define ACPI_NS_ALL ((ACPI_HANDLE)0)158159/*160* Elements of AcpiNsProperties are bit significant161* and should be one-to-one with values of ACPI_OBJECT_TYPE162*/163#define ACPI_NS_NORMAL 0164#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */165#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */166167/* Flags for AcpiNsLookup, AcpiNsSearchAndEnter */168169#define ACPI_NS_NO_UPSEARCH 0170#define ACPI_NS_SEARCH_PARENT 0x0001171#define ACPI_NS_DONT_OPEN_SCOPE 0x0002172#define ACPI_NS_NO_PEER_SEARCH 0x0004173#define ACPI_NS_ERROR_IF_FOUND 0x0008174#define ACPI_NS_PREFIX_IS_SCOPE 0x0010175#define ACPI_NS_EXTERNAL 0x0020176#define ACPI_NS_TEMPORARY 0x0040177#define ACPI_NS_OVERRIDE_IF_FOUND 0x0080178#define ACPI_NS_EARLY_INIT 0x0100179#define ACPI_NS_PREFIX_MUST_EXIST 0x0200180181/* Flags for AcpiNsWalkNamespace */182183#define ACPI_NS_WALK_NO_UNLOCK 0184#define ACPI_NS_WALK_UNLOCK 0x01185#define ACPI_NS_WALK_TEMP_NODES 0x02186187/* Object is not a package element */188189#define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX190#define ACPI_ALL_PACKAGE_ELEMENTS (ACPI_UINT32_MAX-1)191192/* Always emit warning message, not dependent on node flags */193194#define ACPI_WARN_ALWAYS 0195196197/*198* nsinit - Namespace initialization199*/200ACPI_STATUS201AcpiNsInitializeObjects (202void);203204ACPI_STATUS205AcpiNsInitializeDevices (206UINT32 Flags);207208ACPI_STATUS209AcpiNsInitOnePackage (210ACPI_HANDLE ObjHandle,211UINT32 Level,212void *Context,213void **ReturnValue);214215/*216* nsload - Namespace loading217*/218ACPI_STATUS219AcpiNsLoadNamespace (220void);221222ACPI_STATUS223AcpiNsLoadTable (224UINT32 TableIndex,225ACPI_NAMESPACE_NODE *Node);226227228/*229* nswalk - walk the namespace230*/231ACPI_STATUS232AcpiNsWalkNamespace (233ACPI_OBJECT_TYPE Type,234ACPI_HANDLE StartObject,235UINT32 MaxDepth,236UINT32 Flags,237ACPI_WALK_CALLBACK DescendingCallback,238ACPI_WALK_CALLBACK AscendingCallback,239void *Context,240void **ReturnValue);241242ACPI_NAMESPACE_NODE *243AcpiNsGetNextNode (244ACPI_NAMESPACE_NODE *Parent,245ACPI_NAMESPACE_NODE *Child);246247ACPI_NAMESPACE_NODE *248AcpiNsGetNextNodeTyped (249ACPI_OBJECT_TYPE Type,250ACPI_NAMESPACE_NODE *Parent,251ACPI_NAMESPACE_NODE *Child);252253/*254* nsparse - table parsing255*/256ACPI_STATUS257AcpiNsParseTable (258UINT32 TableIndex,259ACPI_NAMESPACE_NODE *StartNode);260261ACPI_STATUS262AcpiNsExecuteTable (263UINT32 TableIndex,264ACPI_NAMESPACE_NODE *StartNode);265266ACPI_STATUS267AcpiNsOneCompleteParse (268UINT32 PassNumber,269UINT32 TableIndex,270ACPI_NAMESPACE_NODE *StartNode);271272273/*274* nsaccess - Top-level namespace access275*/276ACPI_STATUS277AcpiNsRootInitialize (278void);279280ACPI_STATUS281AcpiNsLookup (282ACPI_GENERIC_STATE *ScopeInfo,283char *Name,284ACPI_OBJECT_TYPE Type,285ACPI_INTERPRETER_MODE InterpreterMode,286UINT32 Flags,287ACPI_WALK_STATE *WalkState,288ACPI_NAMESPACE_NODE **RetNode);289290291/*292* nsalloc - Named object allocation/deallocation293*/294ACPI_NAMESPACE_NODE *295AcpiNsCreateNode (296UINT32 Name);297298void299AcpiNsDeleteNode (300ACPI_NAMESPACE_NODE *Node);301302void303AcpiNsRemoveNode (304ACPI_NAMESPACE_NODE *Node);305306void307AcpiNsDeleteNamespaceSubtree (308ACPI_NAMESPACE_NODE *ParentHandle);309310void311AcpiNsDeleteNamespaceByOwner (312ACPI_OWNER_ID OwnerId);313314void315AcpiNsDetachObject (316ACPI_NAMESPACE_NODE *Node);317318void319AcpiNsDeleteChildren (320ACPI_NAMESPACE_NODE *Parent);321322int323AcpiNsCompareNames (324char *Name1,325char *Name2);326327328/*329* nsconvert - Dynamic object conversion routines330*/331ACPI_STATUS332AcpiNsConvertToInteger (333ACPI_OPERAND_OBJECT *OriginalObject,334ACPI_OPERAND_OBJECT **ReturnObject);335336ACPI_STATUS337AcpiNsConvertToString (338ACPI_OPERAND_OBJECT *OriginalObject,339ACPI_OPERAND_OBJECT **ReturnObject);340341ACPI_STATUS342AcpiNsConvertToBuffer (343ACPI_OPERAND_OBJECT *OriginalObject,344ACPI_OPERAND_OBJECT **ReturnObject);345346ACPI_STATUS347AcpiNsConvertToUnicode (348ACPI_NAMESPACE_NODE *Scope,349ACPI_OPERAND_OBJECT *OriginalObject,350ACPI_OPERAND_OBJECT **ReturnObject);351352ACPI_STATUS353AcpiNsConvertToResource (354ACPI_NAMESPACE_NODE *Scope,355ACPI_OPERAND_OBJECT *OriginalObject,356ACPI_OPERAND_OBJECT **ReturnObject);357358ACPI_STATUS359AcpiNsConvertToReference (360ACPI_NAMESPACE_NODE *Scope,361ACPI_OPERAND_OBJECT *OriginalObject,362ACPI_OPERAND_OBJECT **ReturnObject);363364365/*366* nsdump - Namespace dump/print utilities367*/368void369AcpiNsDumpTables (370ACPI_HANDLE SearchBase,371UINT32 MaxDepth);372373void374AcpiNsDumpEntry (375ACPI_HANDLE Handle,376UINT32 DebugLevel);377378void379AcpiNsDumpPathname (380ACPI_HANDLE Handle,381const char *Msg,382UINT32 Level,383UINT32 Component);384385void386AcpiNsPrintPathname (387UINT32 NumSegments,388const char *Pathname);389390ACPI_STATUS391AcpiNsDumpOneObject (392ACPI_HANDLE ObjHandle,393UINT32 Level,394void *Context,395void **ReturnValue);396397void398AcpiNsDumpObjects (399ACPI_OBJECT_TYPE Type,400UINT8 DisplayType,401UINT32 MaxDepth,402ACPI_OWNER_ID OwnerId,403ACPI_HANDLE StartHandle);404405void406AcpiNsDumpObjectPaths (407ACPI_OBJECT_TYPE Type,408UINT8 DisplayType,409UINT32 MaxDepth,410ACPI_OWNER_ID OwnerId,411ACPI_HANDLE StartHandle);412413414/*415* nseval - Namespace evaluation functions416*/417ACPI_STATUS418AcpiNsEvaluate (419ACPI_EVALUATE_INFO *Info);420421422/*423* nsarguments - Argument count/type checking for predefined/reserved names424*/425void426AcpiNsCheckArgumentCount (427char *Pathname,428ACPI_NAMESPACE_NODE *Node,429UINT32 UserParamCount,430const ACPI_PREDEFINED_INFO *Info);431432void433AcpiNsCheckAcpiCompliance (434char *Pathname,435ACPI_NAMESPACE_NODE *Node,436const ACPI_PREDEFINED_INFO *Predefined);437438void439AcpiNsCheckArgumentTypes (440ACPI_EVALUATE_INFO *Info);441442443/*444* nspredef - Return value checking for predefined/reserved names445*/446ACPI_STATUS447AcpiNsCheckReturnValue (448ACPI_NAMESPACE_NODE *Node,449ACPI_EVALUATE_INFO *Info,450UINT32 UserParamCount,451ACPI_STATUS ReturnStatus,452ACPI_OPERAND_OBJECT **ReturnObject);453454ACPI_STATUS455AcpiNsCheckObjectType (456ACPI_EVALUATE_INFO *Info,457ACPI_OPERAND_OBJECT **ReturnObjectPtr,458UINT32 ExpectedBtypes,459UINT32 PackageIndex);460461462/*463* nsprepkg - Validation of predefined name packages464*/465ACPI_STATUS466AcpiNsCheckPackage (467ACPI_EVALUATE_INFO *Info,468ACPI_OPERAND_OBJECT **ReturnObjectPtr);469470471/*472* nsnames - Name and Scope manipulation473*/474UINT32475AcpiNsOpensScope (476ACPI_OBJECT_TYPE Type);477478char *479AcpiNsGetExternalPathname (480ACPI_NAMESPACE_NODE *Node);481482UINT32483AcpiNsBuildNormalizedPath (484ACPI_NAMESPACE_NODE *Node,485char *FullPath,486UINT32 PathSize,487BOOLEAN NoTrailing);488489void490AcpiNsNormalizePathname (491char *OriginalPath);492493char *494AcpiNsGetNormalizedPathname (495ACPI_NAMESPACE_NODE *Node,496BOOLEAN NoTrailing);497498char *499AcpiNsBuildPrefixedPathname (500ACPI_GENERIC_STATE *PrefixScope,501const char *InternalPath);502503char *504AcpiNsNameOfCurrentScope (505ACPI_WALK_STATE *WalkState);506507ACPI_STATUS508AcpiNsHandleToName (509ACPI_HANDLE TargetHandle,510ACPI_BUFFER *Buffer);511512ACPI_STATUS513AcpiNsHandleToPathname (514ACPI_HANDLE TargetHandle,515ACPI_BUFFER *Buffer,516BOOLEAN NoTrailing);517518BOOLEAN519AcpiNsPatternMatch (520ACPI_NAMESPACE_NODE *ObjNode,521char *SearchFor);522523ACPI_STATUS524AcpiNsGetNodeUnlocked (525ACPI_NAMESPACE_NODE *PrefixNode,526const char *ExternalPathname,527UINT32 Flags,528ACPI_NAMESPACE_NODE **OutNode);529530ACPI_STATUS531AcpiNsGetNode (532ACPI_NAMESPACE_NODE *PrefixNode,533const char *ExternalPathname,534UINT32 Flags,535ACPI_NAMESPACE_NODE **OutNode);536537ACPI_SIZE538AcpiNsGetPathnameLength (539ACPI_NAMESPACE_NODE *Node);540541542/*543* nsobject - Object management for namespace nodes544*/545ACPI_STATUS546AcpiNsAttachObject (547ACPI_NAMESPACE_NODE *Node,548ACPI_OPERAND_OBJECT *Object,549ACPI_OBJECT_TYPE Type);550551ACPI_OPERAND_OBJECT *552AcpiNsGetAttachedObject (553ACPI_NAMESPACE_NODE *Node);554555ACPI_OPERAND_OBJECT *556AcpiNsGetSecondaryObject (557ACPI_OPERAND_OBJECT *ObjDesc);558559ACPI_STATUS560AcpiNsAttachData (561ACPI_NAMESPACE_NODE *Node,562ACPI_OBJECT_HANDLER Handler,563void *Data);564565ACPI_STATUS566AcpiNsDetachData (567ACPI_NAMESPACE_NODE *Node,568ACPI_OBJECT_HANDLER Handler);569570ACPI_STATUS571AcpiNsGetAttachedData (572ACPI_NAMESPACE_NODE *Node,573ACPI_OBJECT_HANDLER Handler,574void **Data);575576577/*578* nsrepair - General return object repair for all579* predefined methods/objects580*/581ACPI_STATUS582AcpiNsSimpleRepair (583ACPI_EVALUATE_INFO *Info,584UINT32 ExpectedBtypes,585UINT32 PackageIndex,586ACPI_OPERAND_OBJECT **ReturnObjectPtr);587588ACPI_STATUS589AcpiNsWrapWithPackage (590ACPI_EVALUATE_INFO *Info,591ACPI_OPERAND_OBJECT *OriginalObject,592ACPI_OPERAND_OBJECT **ObjDescPtr);593594ACPI_STATUS595AcpiNsRepairNullElement (596ACPI_EVALUATE_INFO *Info,597UINT32 ExpectedBtypes,598UINT32 PackageIndex,599ACPI_OPERAND_OBJECT **ReturnObjectPtr);600601void602AcpiNsRemoveNullElements (603ACPI_EVALUATE_INFO *Info,604UINT8 PackageType,605ACPI_OPERAND_OBJECT *ObjDesc);606607608/*609* nsrepair2 - Return object repair for specific610* predefined methods/objects611*/612ACPI_STATUS613AcpiNsComplexRepairs (614ACPI_EVALUATE_INFO *Info,615ACPI_NAMESPACE_NODE *Node,616ACPI_STATUS ValidateStatus,617ACPI_OPERAND_OBJECT **ReturnObjectPtr);618619620/*621* nssearch - Namespace searching and entry622*/623ACPI_STATUS624AcpiNsSearchAndEnter (625UINT32 EntryName,626ACPI_WALK_STATE *WalkState,627ACPI_NAMESPACE_NODE *Node,628ACPI_INTERPRETER_MODE InterpreterMode,629ACPI_OBJECT_TYPE Type,630UINT32 Flags,631ACPI_NAMESPACE_NODE **RetNode);632633ACPI_STATUS634AcpiNsSearchOneScope (635UINT32 EntryName,636ACPI_NAMESPACE_NODE *Node,637ACPI_OBJECT_TYPE Type,638ACPI_NAMESPACE_NODE **RetNode);639640void641AcpiNsInstallNode (642ACPI_WALK_STATE *WalkState,643ACPI_NAMESPACE_NODE *ParentNode,644ACPI_NAMESPACE_NODE *Node,645ACPI_OBJECT_TYPE Type);646647648/*649* nsutils - Utility functions650*/651ACPI_OBJECT_TYPE652AcpiNsGetType (653ACPI_NAMESPACE_NODE *Node);654655UINT32656AcpiNsLocal (657ACPI_OBJECT_TYPE Type);658659void660AcpiNsPrintNodePathname (661ACPI_NAMESPACE_NODE *Node,662const char *Msg);663664ACPI_STATUS665AcpiNsBuildInternalName (666ACPI_NAMESTRING_INFO *Info);667668void669AcpiNsGetInternalNameLength (670ACPI_NAMESTRING_INFO *Info);671672ACPI_STATUS673AcpiNsInternalizeName (674const char *DottedName,675char **ConvertedName);676677ACPI_STATUS678AcpiNsExternalizeName (679UINT32 InternalNameLength,680const char *InternalName,681UINT32 *ConvertedNameLength,682char **ConvertedName);683684ACPI_NAMESPACE_NODE *685AcpiNsValidateHandle (686ACPI_HANDLE Handle);687688void689AcpiNsTerminate (690void);691692#endif /* __ACNAMESP_H__ */693694695