xgehal-mm.h revision a23fd118e437af0a7877dd313db8fdaa3537c675
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2002-2005 Neterion, Inc.
* All right Reserved.
*
* FileName : xgehal-mm.h
*
* Description: memory pool object
*
* Created: 28 May 2004
*/
#ifndef XGE_HAL_MM_H
#define XGE_HAL_MM_H
#include "xge-os-pal.h"
#include "xge-debug.h"
#include "xgehal-types.h"
#include "xgehal-driver.h"
typedef void* xge_hal_mempool_h;
/*
* struct xge_hal_mempool_dma_t - Represents DMA objects passed to the
caller.
*/
typedef struct xge_hal_mempool_dma_t {
/*
* @mempoolh: Memory pool handle.
* @item: Item that gets allocated or freed.
* @index: Item's index in the memory pool.
* @is_last: True, if this item is the last one in the pool; false - otherwise.
* userdat: Per-pool user context.
*
* Memory pool allocation/deallocation callback.
*/
void *memblock, int memblock_index,
/*
* struct xge_hal_mempool_t - Memory pool.
*/
typedef struct xge_hal_mempool_t {
void *userdata;
void **memblocks_arr;
void **memblocks_priv_arr;
int memblock_size;
int memblocks_max;
int memblocks_allocated;
int item_size;
int items_max;
int items_initial;
int items_current;
int items_per_memblock;
void **items_arr;
void **shadow_items_arr;
int items_priv_size;
/*
* __hal_mempool_item - Returns pointer to the item in the mempool
* items array.
*/
static inline void*
{
}
/*
* __hal_mempool_item_priv - will return pointer on per item private space
*/
static inline void*
void *item, int *memblock_item_idx)
{
}
/*
* __hal_mempool_items_arr - will return pointer to the items array in the
* mempool.
*/
static inline void*
{
}
/*
* __hal_mempool_memblock - will return pointer to the memblock in the
* mempool memblocks array.
*/
static inline void*
{
}
/*
* __hal_mempool_memblock_dma - will return pointer to the dma block
* corresponds to the memblock(identified by memblock_idx) in the mempool.
*/
static inline xge_hal_mempool_dma_t*
{
}
int num_allocate, int *num_allocated);
#endif /* XGE_HAL_MM_H */