utcopy.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross/******************************************************************************
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Module Name: utcopy - Internal to external object translation utilities
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * $Revision: 120 $
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross *****************************************************************************/
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross/******************************************************************************
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 1. Copyright Notice
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * All rights reserved.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 2. License
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 2.1. This is your license from Intel Corp. under its intellectual property
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * rights. You may have additional license terms from the party that provided
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * you this software, covering your right to use that party's intellectual
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * property rights.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * copy of the source code appearing in this file ("Covered Code") an
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * irrevocable, perpetual, worldwide license under Intel's copyrights in the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * base code distributed originally by Intel ("Original Intel Code") to copy,
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * make derivatives, distribute, use and display any portion of the Covered
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Code in any form, with the right to sublicense such rights; and
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * license (with the right to sublicense), under only those claims of Intel
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * patents that are infringed by the Original Intel Code, to make, use, sell,
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * offer to sell, and import the Covered Code and derivative works thereof
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * solely to the minimum extent necessary to exercise the above copyright
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * license, and in no event shall the patent license extend to any additions
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * to or modifications of the Original Intel Code. No other license or right
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * is granted directly or by implication, estoppel or otherwise;
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * The above copyright and patent license is granted only if the following
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * conditions are met:
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 3. Conditions
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 3.1. Redistribution of Source with Rights to Further Distribute Source.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Redistribution of source code of any substantial portion of the Covered
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Code or modification with rights to further distribute source must include
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * the above Copyright Notice, the above License, this list of Conditions,
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * and the following Disclaimer and Export Compliance provision. In addition,
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Licensee must cause all Covered Code to which Licensee contributes to
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * contain a file documenting the changes Licensee made to create that Covered
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Code and the date of any change. Licensee must include in that file the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * documentation of any changes made by any predecessor Licensee. Licensee
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * must include a prominent statement that the modification is derived,
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * directly or indirectly, from Original Intel Code.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Redistribution of source code of any substantial portion of the Covered
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Code or modification without rights to further distribute source must
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * include the following Disclaimer and Export Compliance provision in the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * documentation and/or other materials provided with distribution. In
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * addition, Licensee may not authorize further sublicense of source of any
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * portion of the Covered Code, and must include terms to the effect that the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * license from Licensee to its licensee is limited to the intellectual
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * property embodied in the software Licensee provides to its licensee, and
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * not to intellectual property embodied in modifications its licensee may
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 3.3. Redistribution of Executable. Redistribution in executable form of any
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * substantial portion of the Covered Code or modification must reproduce the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * above Copyright Notice, and the following Disclaimer and Export Compliance
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * provision in the documentation and/or other materials provided with the
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * distribution.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 3.4. Intel retains all right, title, and interest in and to the Original
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Intel Code.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 3.5. Neither the name Intel nor any other trademark owned or controlled by
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * Intel shall be used in advertising or otherwise to promote the sale, use or
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * other dealings in products derived from or relating to the Covered Code
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * without prior written authorization from Intel.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 4. Disclaimer and Export Compliance
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * PARTICULAR PURPOSE.
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
a90cf9f29973990687fa61de9f1f6ea22e924e40Gordon Ross * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
#define __UTCOPY_C__
#include "acpi.h"
#include "amlcode.h"
static ACPI_STATUS
static ACPI_STATUS
void *Context);
static ACPI_STATUS
static ACPI_STATUS
static ACPI_STATUS
static ACPI_STATUS
void *Context);
static ACPI_STATUS
static ACPI_STATUS
*BufferSpaceUsed = 0;
if (!InternalObject)
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
case ACPI_TYPE_INTEGER:
case AML_INT_NAMEPATH_OP:
case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_POWER:
static ACPI_STATUS
void *Context)
switch (ObjectType)
case ACPI_COPY_TYPE_SIMPLE:
return (Status);
case ACPI_COPY_TYPE_PACKAGE:
sizeof (ACPI_OBJECT));
return (AE_BAD_PARAMETER);
return (Status);
static ACPI_STATUS
sizeof (ACPI_OBJECT));
static ACPI_STATUS
case ACPI_TYPE_STRING:
case ACPI_TYPE_BUFFER:
case ACPI_TYPE_INTEGER:
if (!InternalObject)
case ACPI_TYPE_STRING:
goto ErrorExit;
case ACPI_TYPE_BUFFER:
goto ErrorExit;
case ACPI_TYPE_INTEGER:
#ifdef ACPI_FUTURE_IMPLEMENTATION
static ACPI_STATUS
static ACPI_STATUS
sizeof (ACPI_OPERAND_OBJECT));
case ACPI_TYPE_BUFFER:
return (AE_NO_MEMORY);
case ACPI_TYPE_STRING:
return (AE_NO_MEMORY);
return (AE_OK);
static ACPI_STATUS
void *Context)
switch (ObjectType)
case ACPI_COPY_TYPE_SIMPLE:
if (SourceObject)
if (!TargetObject)
return (AE_NO_MEMORY);
goto ErrorExit;
case ACPI_COPY_TYPE_PACKAGE:
if (!TargetObject)
return (AE_NO_MEMORY);
goto ErrorExit;
return (AE_BAD_PARAMETER);
return (Status);
return (Status);
static ACPI_STATUS
if (!*DestDesc)