/******************************************************************************
*
* Module Name: utxface - External interfaces, miscellaneous utility functions
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#define EXPORT_ACPI_INTERFACES
#include "acpi.h"
#include "accommon.h"
#include "acdebug.h"
ACPI_MODULE_NAME ("utxface")
/*******************************************************************************
*
* FUNCTION: AcpiTerminate
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Shutdown the ACPICA subsystem and release all resources.
*
******************************************************************************/
void)
{
/* Shutdown and free all resources */
/* Free the mutex objects */
/* Now we can shutdown the OS-dependent layer */
Status = AcpiOsTerminate ();
}
#ifndef ACPI_ASL_COMPILER
/*******************************************************************************
*
* FUNCTION: AcpiSubsystemStatus
*
* PARAMETERS: None
*
* RETURN: Status of the ACPI subsystem
*
* DESCRIPTION: Other drivers that use the ACPI subsystem should call this
* before making any other calls, to ensure the subsystem
* initialized successfully.
*
******************************************************************************/
void)
{
{
return (AE_OK);
}
else
{
return (AE_ERROR);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiGetSystemInfo
*
* PARAMETERS: OutBuffer - A buffer to receive the resources for the
* device
*
* RETURN: Status - the status of the call
*
* DESCRIPTION: This function is called to get information about the current
* state of the ACPI subsystem. It will return system information
* in the OutBuffer.
*
* If the function fails an appropriate status will be returned
* and the value of OutBuffer is undefined.
*
******************************************************************************/
{
/* Parameter validation */
if (ACPI_FAILURE (Status))
{
}
if (ACPI_FAILURE (Status))
{
}
/*
* Populate the return buffer
*/
/* System flags (ACPI capabilities) */
/* Timer resolution - 24 or 32 bits */
{
}
else
{
}
/* Clear the reserved fields */
/* Current debug levels */
}
/*******************************************************************************
*
* FUNCTION: AcpiGetStatistics
*
* PARAMETERS: Stats - Where the statistics are returned
*
* RETURN: Status - the status of the call
*
* DESCRIPTION: Get the contents of the various system counters
*
******************************************************************************/
{
/* Parameter validation */
if (!Stats)
{
}
/* Various interrupt-based event counters */
sizeof (AcpiFixedEventCount));
/* Other counters */
}
/*****************************************************************************
*
* FUNCTION: AcpiInstallInitializationHandler
*
* PARAMETERS: Handler - Callback procedure
* Function - Not (currently) used, see below
*
* RETURN: Status
*
* DESCRIPTION: Install an initialization handler
*
* TBD: When a second function is added, must save the Function also.
*
****************************************************************************/
{
if (!Handler)
{
return (AE_BAD_PARAMETER);
}
if (AcpiGbl_InitHandler)
{
return (AE_ALREADY_EXISTS);
}
return (AE_OK);
}
/*****************************************************************************
*
* FUNCTION: AcpiPurgeCachedObjects
*
* PARAMETERS: None
*
* RETURN: Status
*
* DESCRIPTION: Empty all caches (delete the cached objects)
*
****************************************************************************/
void)
{
(void) AcpiOsPurgeCache (AcpiGbl_StateCache);
(void) AcpiOsPurgeCache (AcpiGbl_OperandCache);
(void) AcpiOsPurgeCache (AcpiGbl_PsNodeCache);
(void) AcpiOsPurgeCache (AcpiGbl_PsNodeExtCache);
}
/*****************************************************************************
*
* FUNCTION: AcpiInstallInterface
*
* PARAMETERS: InterfaceName - The interface to install
*
* RETURN: Status
*
* DESCRIPTION: Install an _OSI interface to the global list
*
****************************************************************************/
{
/* Parameter validation */
{
return (AE_BAD_PARAMETER);
}
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* Check if the interface name is already in the global list */
if (InterfaceInfo)
{
/*
* The interface already exists in the list. This is OK if the
* interface has been marked invalid -- just clear the bit.
*/
{
}
else
{
}
}
else
{
/* New interface name, install into the global list */
}
return (Status);
}
/*****************************************************************************
*
* FUNCTION: AcpiRemoveInterface
*
* PARAMETERS: InterfaceName - The interface to remove
*
* RETURN: Status
*
* DESCRIPTION: Remove an _OSI interface from the global list
*
****************************************************************************/
{
/* Parameter validation */
{
return (AE_BAD_PARAMETER);
}
if (ACPI_FAILURE (Status))
{
return (Status);
}
return (Status);
}
/*****************************************************************************
*
* FUNCTION: AcpiInstallInterfaceHandler
*
* PARAMETERS: Handler - The _OSI interface handler to install
* NULL means "remove existing handler"
*
* RETURN: Status
*
* DESCRIPTION: Install a handler for the predefined _OSI ACPI method.
* invoked during execution of the internal implementation of
* _OSI. A NULL handler simply removes any existing handler.
*
****************************************************************************/
{
if (ACPI_FAILURE (Status))
{
return (Status);
}
if (Handler && AcpiGbl_InterfaceHandler)
{
}
else
{
}
return (Status);
}
/*****************************************************************************
*
* FUNCTION: AcpiUpdateInterfaces
*
* PARAMETERS: Action - Actions to be performed during the
* update
*
* RETURN: Status
*
* DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
*
****************************************************************************/
{
if (ACPI_FAILURE (Status))
{
return (Status);
}
return (Status);
}
/*****************************************************************************
*
* FUNCTION: AcpiCheckAddressRange
*
* PARAMETERS: SpaceId - Address space ID
* Address - Start address
* Length - Length
* Warn - TRUE if warning on overlap desired
*
* RETURN: Count of the number of conflicts detected.
*
* DESCRIPTION: Check if the input address range overlaps any of the
* ASL operation region address ranges.
*
****************************************************************************/
{
if (ACPI_FAILURE (Status))
{
return (0);
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return (Overlaps);
}
#endif /* !ACPI_ASL_COMPILER */
/*******************************************************************************
*
* FUNCTION: AcpiDecodePldBuffer
*
* PARAMETERS: InBuffer - Buffer returned by _PLD method
* Length - Length of the InBuffer
* ReturnBuffer - Where the decode buffer is returned
*
* RETURN: Status and the decoded _PLD buffer. User must deallocate
* the buffer via ACPI_FREE.
*
* DESCRIPTION: Decode the bit-packed buffer returned by the _PLD method into
* a local struct that is much more useful to an ACPI driver.
*
******************************************************************************/
{
/* Parameter validation */
{
return (AE_BAD_PARAMETER);
}
if (!PldInfo)
{
return (AE_NO_MEMORY);
}
/* First 32-bit DWord */
/* Second 32-bit DWord */
/* Third 32-bit DWord */
/* Fourth 32-bit DWord */
if (Length >= ACPI_PLD_REV2_BUFFER_SIZE)
{
/* Fifth 32-bit DWord (Revision 2 of _PLD) */
}
*ReturnBuffer = PldInfo;
return (AE_OK);
}