FreeBSD/sys/contrib/dev/acpica/components/utilities/utcache.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiOsCreateCache
 *
 * PARAMETERS:  CacheName       - Ascii name for the cache
 *              ObjectSize      - Size of each cached object
 *              MaxDepth        - Maximum depth of the cache (in objects)
 *              ReturnCache     - Where the new cache object is returned
 *
 * RETURN:      Status
 *
 * DESCRIPTION: Create a cache object
 *
 ******************************************************************************/
AcpiOsCreateCache
PARAMETERS:  CacheName       - Ascii name for the cache
ObjectSize      - Size of each cached object
MaxDepth        - Maximum depth of the cache (in objects)
ReturnCache     - Where the new cache object is returned

Status

Create a cache object
AcpiOsCreateCache PARAMETERS : CacheName - Ascii name for the cache ObjectSize - Size of each cached object MaxDepth - Maximum depth of the cache ( in objects ) ReturnCache - Where the new cache object is returned Status Create a cache object
ACPI_STATUS
AcpiOsCreateCache (
    char                    *CacheName,
    UINT16                  ObjectSize,
    UINT16                  MaxDepth,
    ACPI_MEMORY_LIST        **ReturnCache)
{
    ACPI_MEMORY_LIST        *Cache;
    ACPI_FUNCTION_ENTRY ();
    if (!CacheName || !ReturnCache || (ObjectSize < 16))
    {
        return (AE_BAD_PARAMETER);
    }
    Cache = AcpiOsAllocate (sizeof (ACPI_MEMORY_LIST));
    if (!Cache)
    {
        return (AE_NO_MEMORY);
    }
    memset (Cache, 0, sizeof (ACPI_MEMORY_LIST));
    Cache->ListName = CacheName;
    Cache->ObjectSize = ObjectSize;
    Cache->MaxDepth = MaxDepth;
    *ReturnCache = Cache;
    return (AE_OK);
}
ACPI_STATUS AcpiOsCreateCache ( char * CacheName , UINT16 ObjectSize , UINT16 MaxDepth , ACPI_MEMORY_LIST * * ReturnCache ) { ACPI_MEMORY_LIST * Cache ; ACPI_FUNCTION_ENTRY ( ) ; if ( ! CacheName || ! ReturnCache || ( ObjectSize < 16 ) ) { return ( AE_BAD_PARAMETER ) ; } Cache = AcpiOsAllocate ( sizeof ( ACPI_MEMORY_LIST ) ) ; if ( ! Cache ) { return ( AE_NO_MEMORY ) ; } memset ( Cache , 0 , sizeof ( ACPI_MEMORY_LIST ) ) ; Cache -> ListName = CacheName ; Cache -> ObjectSize = ObjectSize ; Cache -> MaxDepth = MaxDepth ; * ReturnCache = Cache ; return ( AE_OK ) ; }
FUNCTION:    AcpiOsCreateCache
 PARAMETERS:  CacheName       - Ascii name for the cache
              ObjectSize      - Size of each cached object
              MaxDepth        - Maximum depth of the cache (in objects)
              ReturnCache     - Where the new cache object is returned
FUNCTION : AcpiOsCreateCache PARAMETERS : CacheName - Ascii name for the cache ObjectSize - Size of each cached object MaxDepth - Maximum depth of the cache ( in objects ) ReturnCache - Where the new cache object is returned
/* Create the cache object */ /* Populate the cache object and return it */