Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/drivers/acpi/acresrc.h need to be fixed.

0001 /******************************************************************************
0002  *
0003  * Name: acresrc.h - Resource Manager function prototypes
0004  *
0005  *****************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights.  You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025 
0026  * make derivatives, distribute, use and display any portion of the Covered
0027  * Code in any form, with the right to sublicense such rights; and
0028  *
0029  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0030  * license (with the right to sublicense), under only those claims of Intel
0031  * patents that are infringed by the Original Intel Code, to make, use, sell,
0032  * offer to sell, and import the Covered Code and derivative works thereof
0033  * solely to the minimum extent necessary to exercise the above copyright
0034  * license, and in no event shall the patent license extend to any additions
0035  * to or modifications of the Original Intel Code.  No other license or right
0036  * is granted directly or by implication, estoppel or otherwise;
0037  *
0038  * The above copyright and patent license is granted only if the following
0039  * conditions are met:
0040  *
0041  * 3. Conditions
0042  *
0043  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0044  * Redistribution of source code of any substantial portion of the Covered
0045  * Code or modification with rights to further distribute source must include
0046  * the above Copyright Notice, the above License, this list of Conditions,
0047  * and the following Disclaimer and Export Compliance provision.  In addition,
0048  * Licensee must cause all Covered Code to which Licensee contributes to
0049  * contain a file documenting the changes Licensee made to create that Covered
0050  * Code and the date of any change.  Licensee must include in that file the
0051  * documentation of any changes made by any predecessor Licensee.  Licensee
0052  * must include a prominent statement that the modification is derived,
0053  * directly or indirectly, from Original Intel Code.
0054  *
0055  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0056  * Redistribution of source code of any substantial portion of the Covered
0057  * Code or modification without rights to further distribute source must
0058  * include the following Disclaimer and Export Compliance provision in the
0059  * documentation and/or other materials provided with distribution.  In
0060  * addition, Licensee may not authorize further sublicense of source of any
0061  * portion of the Covered Code, and must include terms to the effect that the
0062  * license from Licensee to its licensee is limited to the intellectual
0063  * property embodied in the software Licensee provides to its licensee, and
0064  * not to intellectual property embodied in modifications its licensee may
0065  * make.
0066  *
0067  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0068  * substantial portion of the Covered Code or modification must reproduce the
0069  * above Copyright Notice, and the following Disclaimer and Export Compliance
0070  * provision in the documentation and/or other materials provided with the
0071  * distribution.
0072  *
0073  * 3.4. Intel retains all right, title, and interest in and to the Original
0074  * Intel Code.
0075  *
0076  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0077  * Intel shall be used in advertising or otherwise to promote the sale, use or
0078  * other dealings in products derived from or relating to the Covered Code
0079  * without prior written authorization from Intel.
0080  *
0081  * 4. Disclaimer and Export Compliance
0082  *
0083  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0084  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0085  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
0086  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
0087  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
0088  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0089  * PARTICULAR PURPOSE.
0090  *
0091  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0092  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0093  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0094  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0095  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0096  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
0097  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0098  * LIMITED REMEDY.
0099  *
0100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0101  * software or system incorporating such software without first obtaining any
0102  * required license or other approval from the U. S. Department of Commerce or
0103  * any other agency or department of the United States Government.  In the
0104  * event Licensee exports any such software from the United States or
0105  * re-exports any such software from a foreign destination, Licensee shall
0106  * ensure that the distribution and export/re-export of the software is in
0107  * compliance with all laws, regulations, orders, or other restrictions of the
0108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0109  * any of its subsidiaries will export/re-export any technical data, process,
0110  * software, or service, directly or indirectly, to any country for which the
0111  * United States government or any agency thereof requires an export license,
0112  * other governmental approval, or letter of assurance, without first obtaining
0113  * such license, approval or letter.
0114  *
0115  *****************************************************************************/
0116 
0117 #ifndef __ACRESRC_H__
0118 #define __ACRESRC_H__
0119 
0120 /* Need the AML resource descriptor structs */
0121 
0122 #include "amlresrc.h"
0123 
0124 
0125 /*
0126  * If possible, pack the following structures to byte alignment, since we
0127  * don't care about performance for debug output. Two cases where we cannot
0128  * pack the structures:
0129  *
0130  * 1) Hardware does not support misaligned memory transfers
0131  * 2) Compiler does not support pointers within packed structures
0132  */
0133 #if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
0134 #pragma pack(1)
0135 #endif
0136 
0137 /*
0138  * Individual entry for the resource conversion tables
0139  */
0140 typedef const struct acpi_rsconvert_info
0141 {
0142     UINT8                   Opcode;
0143     UINT8                   ResourceOffset;
0144     UINT8                   AmlOffset;
0145     UINT8                   Value;
0146 
0147 } ACPI_RSCONVERT_INFO;
0148 
0149 /* Resource conversion opcodes */
0150 
0151 #define ACPI_RSC_INITGET                0
0152 #define ACPI_RSC_INITSET                1
0153 #define ACPI_RSC_FLAGINIT               2
0154 #define ACPI_RSC_1BITFLAG               3
0155 #define ACPI_RSC_2BITFLAG               4
0156 #define ACPI_RSC_COUNT                  5
0157 #define ACPI_RSC_COUNT16                6
0158 #define ACPI_RSC_LENGTH                 7
0159 #define ACPI_RSC_MOVE8                  8
0160 #define ACPI_RSC_MOVE16                 9
0161 #define ACPI_RSC_MOVE32                 10
0162 #define ACPI_RSC_MOVE64                 11
0163 #define ACPI_RSC_SET8                   12
0164 #define ACPI_RSC_DATA8                  13
0165 #define ACPI_RSC_ADDRESS                14
0166 #define ACPI_RSC_SOURCE                 15
0167 #define ACPI_RSC_SOURCEX                16
0168 #define ACPI_RSC_BITMASK                17
0169 #define ACPI_RSC_BITMASK16              18
0170 #define ACPI_RSC_EXIT_NE                19
0171 #define ACPI_RSC_EXIT_LE                20
0172 #define ACPI_RSC_EXIT_EQ                21
0173 
0174 /* Resource Conversion sub-opcodes */
0175 
0176 #define ACPI_RSC_COMPARE_AML_LENGTH     0
0177 #define ACPI_RSC_COMPARE_VALUE          1
0178 
0179 #define ACPI_RSC_TABLE_SIZE(d)          (sizeof (d) / sizeof (ACPI_RSCONVERT_INFO))
0180 
0181 #define ACPI_RS_OFFSET(f)               (UINT8) ACPI_OFFSET (ACPI_RESOURCE,f)
0182 #define AML_OFFSET(f)                   (UINT8) ACPI_OFFSET (AML_RESOURCE,f)
0183 
0184 
0185 typedef const struct acpi_rsdump_info
0186 {
0187     UINT8                   Opcode;
0188     UINT8                   Offset;
0189     char                    *Name;
0190     const char              **Pointer;
0191 
0192 } ACPI_RSDUMP_INFO;
0193 
0194 /* Values for the Opcode field above */
0195 
0196 #define ACPI_RSD_TITLE                  0
0197 #define ACPI_RSD_LITERAL                1
0198 #define ACPI_RSD_STRING                 2
0199 #define ACPI_RSD_UINT8                  3
0200 #define ACPI_RSD_UINT16                 4
0201 #define ACPI_RSD_UINT32                 5
0202 #define ACPI_RSD_UINT64                 6
0203 #define ACPI_RSD_1BITFLAG               7
0204 #define ACPI_RSD_2BITFLAG               8
0205 #define ACPI_RSD_SHORTLIST              9
0206 #define ACPI_RSD_LONGLIST               10
0207 #define ACPI_RSD_DWORDLIST              11
0208 #define ACPI_RSD_ADDRESS                12
0209 #define ACPI_RSD_SOURCE                 13
0210 
0211 /* restore default alignment */
0212 
0213 #pragma pack()
0214 
0215 
0216 /* Resource tables indexed by internal resource type */
0217 
0218 extern const UINT8              AcpiGbl_AmlResourceSizes[];
0219 extern ACPI_RSCONVERT_INFO      *AcpiGbl_SetResourceDispatch[];
0220 
0221 /* Resource tables indexed by raw AML resource descriptor type */
0222 
0223 extern const UINT8              AcpiGbl_ResourceStructSizes[];
0224 extern ACPI_RSCONVERT_INFO      *AcpiGbl_GetResourceDispatch[];
0225 
0226 
0227 typedef struct acpi_vendor_walk_info
0228 {
0229     ACPI_VENDOR_UUID        *Uuid;
0230     ACPI_BUFFER             *Buffer;
0231     ACPI_STATUS             Status;
0232 
0233 } ACPI_VENDOR_WALK_INFO;
0234 
0235 
0236 /*
0237  * rscreate
0238  */
0239 ACPI_STATUS
0240 AcpiRsCreateResourceList (
0241     ACPI_OPERAND_OBJECT     *AmlBuffer,
0242     ACPI_BUFFER             *OutputBuffer);
0243 
0244 ACPI_STATUS
0245 AcpiRsCreateAmlResources (
0246     ACPI_RESOURCE           *LinkedListBuffer,
0247     ACPI_BUFFER             *OutputBuffer);
0248 
0249 ACPI_STATUS
0250 AcpiRsCreatePciRoutingTable (
0251     ACPI_OPERAND_OBJECT     *PackageObject,
0252     ACPI_BUFFER             *OutputBuffer);
0253 
0254 
0255 /*
0256  * rsutils
0257  */
0258 ACPI_STATUS
0259 AcpiRsGetPrtMethodData (
0260     ACPI_NAMESPACE_NODE     *Node,
0261     ACPI_BUFFER             *RetBuffer);
0262 
0263 ACPI_STATUS
0264 AcpiRsGetCrsMethodData (
0265     ACPI_NAMESPACE_NODE     *Node,
0266     ACPI_BUFFER             *RetBuffer);
0267 
0268 ACPI_STATUS
0269 AcpiRsGetPrsMethodData (
0270     ACPI_NAMESPACE_NODE     *Node,
0271     ACPI_BUFFER             *RetBuffer);
0272 
0273 ACPI_STATUS
0274 AcpiRsGetMethodData (
0275     ACPI_HANDLE             Handle,
0276     char                    *Path,
0277     ACPI_BUFFER             *RetBuffer);
0278 
0279 ACPI_STATUS
0280 AcpiRsSetSrsMethodData (
0281     ACPI_NAMESPACE_NODE     *Node,
0282     ACPI_BUFFER             *RetBuffer);
0283 
0284 
0285 /*
0286  * rscalc
0287  */
0288 ACPI_STATUS
0289 AcpiRsGetListLength (
0290     UINT8                   *AmlBuffer,
0291     UINT32                  AmlBufferLength,
0292     ACPI_SIZE               *SizeNeeded);
0293 
0294 ACPI_STATUS
0295 AcpiRsGetAmlLength (
0296     ACPI_RESOURCE           *LinkedListBuffer,
0297     ACPI_SIZE               *SizeNeeded);
0298 
0299 ACPI_STATUS
0300 AcpiRsGetPciRoutingTableLength (
0301     ACPI_OPERAND_OBJECT     *PackageObject,
0302     ACPI_SIZE               *BufferSizeNeeded);
0303 
0304 ACPI_STATUS
0305 AcpiRsConvertAmlToResources (
0306     UINT8                   *Aml,
0307     UINT32                  Length,
0308     UINT32                  Offset,
0309     UINT8                   ResourceIndex,
0310     void                    *Context);
0311 
0312 ACPI_STATUS
0313 AcpiRsConvertResourcesToAml (
0314     ACPI_RESOURCE           *Resource,
0315     ACPI_SIZE               AmlSizeNeeded,
0316     UINT8                   *OutputBuffer);
0317 
0318 
0319 /*
0320  * rsaddr
0321  */
0322 void
0323 AcpiRsSetAddressCommon (
0324     AML_RESOURCE            *Aml,
0325     ACPI_RESOURCE           *Resource);
0326 
0327 BOOLEAN
0328 AcpiRsGetAddressCommon (
0329     ACPI_RESOURCE           *Resource,
0330     AML_RESOURCE            *Aml);
0331 
0332 
0333 /*
0334  * rsmisc
0335  */
0336 ACPI_STATUS
0337 AcpiRsConvertAmlToResource (
0338     ACPI_RESOURCE           *Resource,
0339     AML_RESOURCE            *Aml,
0340     ACPI_RSCONVERT_INFO     *Info);
0341 
0342 ACPI_STATUS
0343 AcpiRsConvertResourceToAml (
0344     ACPI_RESOURCE           *Resource,
0345     AML_RESOURCE            *Aml,
0346     ACPI_RSCONVERT_INFO     *Info);
0347 
0348 
0349 /*
0350  * rsutils
0351  */
0352 void
0353 AcpiRsMoveData (
0354     void                    *Destination,
0355     void                    *Source,
0356     UINT16                  ItemCount,
0357     UINT8                   MoveType);
0358 
0359 UINT8
0360 AcpiRsDecodeBitmask (
0361     UINT16                  Mask,
0362     UINT8                   *List);
0363 
0364 UINT16
0365 AcpiRsEncodeBitmask (
0366     UINT8                   *List,
0367     UINT8                   Count);
0368 
0369 ACPI_RS_LENGTH
0370 AcpiRsGetResourceSource (
0371     ACPI_RS_LENGTH          ResourceLength,
0372     ACPI_RS_LENGTH          MinimumLength,
0373     ACPI_RESOURCE_SOURCE    *ResourceSource,
0374     AML_RESOURCE            *Aml,
0375     char                    *StringPtr);
0376 
0377 ACPI_RSDESC_SIZE
0378 AcpiRsSetResourceSource (
0379     AML_RESOURCE            *Aml,
0380     ACPI_RS_LENGTH          MinimumLength,
0381     ACPI_RESOURCE_SOURCE    *ResourceSource);
0382 
0383 void
0384 AcpiRsSetResourceHeader (
0385     UINT8                   DescriptorType,
0386     ACPI_RSDESC_SIZE        TotalLength,
0387     AML_RESOURCE            *Aml);
0388 
0389 void
0390 AcpiRsSetResourceLength (
0391     ACPI_RSDESC_SIZE        TotalLength,
0392     AML_RESOURCE            *Aml);
0393 
0394 
0395 /*
0396  * rsdump
0397  */
0398 void
0399 AcpiRsDumpResourceList (
0400     ACPI_RESOURCE           *Resource);
0401 
0402 void
0403 AcpiRsDumpIrqList (
0404     UINT8                   *RouteTable);
0405 
0406 
0407 /*
0408  * Resource conversion tables
0409  */
0410 extern ACPI_RSCONVERT_INFO      AcpiRsConvertDma[];
0411 extern ACPI_RSCONVERT_INFO      AcpiRsConvertEndDpf[];
0412 extern ACPI_RSCONVERT_INFO      AcpiRsConvertIo[];
0413 extern ACPI_RSCONVERT_INFO      AcpiRsConvertFixedIo[];
0414 extern ACPI_RSCONVERT_INFO      AcpiRsConvertEndTag[];
0415 extern ACPI_RSCONVERT_INFO      AcpiRsConvertMemory24[];
0416 extern ACPI_RSCONVERT_INFO      AcpiRsConvertGenericReg[];
0417 extern ACPI_RSCONVERT_INFO      AcpiRsConvertMemory32[];
0418 extern ACPI_RSCONVERT_INFO      AcpiRsConvertFixedMemory32[];
0419 extern ACPI_RSCONVERT_INFO      AcpiRsConvertAddress32[];
0420 extern ACPI_RSCONVERT_INFO      AcpiRsConvertAddress16[];
0421 extern ACPI_RSCONVERT_INFO      AcpiRsConvertExtIrq[];
0422 extern ACPI_RSCONVERT_INFO      AcpiRsConvertAddress64[];
0423 extern ACPI_RSCONVERT_INFO      AcpiRsConvertExtAddress64[];
0424 
0425 /* These resources require separate get/set tables */
0426 
0427 extern ACPI_RSCONVERT_INFO      AcpiRsGetIrq[];
0428 extern ACPI_RSCONVERT_INFO      AcpiRsGetStartDpf[];
0429 extern ACPI_RSCONVERT_INFO      AcpiRsGetVendorSmall[];
0430 extern ACPI_RSCONVERT_INFO      AcpiRsGetVendorLarge[];
0431 
0432 extern ACPI_RSCONVERT_INFO      AcpiRsSetIrq[];
0433 extern ACPI_RSCONVERT_INFO      AcpiRsSetStartDpf[];
0434 extern ACPI_RSCONVERT_INFO      AcpiRsSetVendor[];
0435 
0436 
0437 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
0438 /*
0439  * rsinfo
0440  */
0441 extern ACPI_RSDUMP_INFO         *AcpiGbl_DumpResourceDispatch[];
0442 
0443 /*
0444  * rsdump
0445  */
0446 extern ACPI_RSDUMP_INFO         AcpiRsDumpIrq[];
0447 extern ACPI_RSDUMP_INFO         AcpiRsDumpDma[];
0448 extern ACPI_RSDUMP_INFO         AcpiRsDumpStartDpf[];
0449 extern ACPI_RSDUMP_INFO         AcpiRsDumpEndDpf[];
0450 extern ACPI_RSDUMP_INFO         AcpiRsDumpIo[];
0451 extern ACPI_RSDUMP_INFO         AcpiRsDumpFixedIo[];
0452 extern ACPI_RSDUMP_INFO         AcpiRsDumpVendor[];
0453 extern ACPI_RSDUMP_INFO         AcpiRsDumpEndTag[];
0454 extern ACPI_RSDUMP_INFO         AcpiRsDumpMemory24[];
0455 extern ACPI_RSDUMP_INFO         AcpiRsDumpMemory32[];
0456 extern ACPI_RSDUMP_INFO         AcpiRsDumpFixedMemory32[];
0457 extern ACPI_RSDUMP_INFO         AcpiRsDumpAddress16[];
0458 extern ACPI_RSDUMP_INFO         AcpiRsDumpAddress32[];
0459 extern ACPI_RSDUMP_INFO         AcpiRsDumpAddress64[];
0460 extern ACPI_RSDUMP_INFO         AcpiRsDumpExtAddress64[];
0461 extern ACPI_RSDUMP_INFO         AcpiRsDumpExtIrq[];
0462 extern ACPI_RSDUMP_INFO         AcpiRsDumpGenericReg[];
0463 #endif
0464 
0465 #endif  /* __ACRESRC_H__ */