#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/export.h>
#include <linux/bitmap.h>
#include <linux/dma-mapping.h>
#include <linux/vmalloc.h>
#include "mlx4.h"
u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap)
{ … }
void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj, int use_rr)
{ … }
static unsigned long find_aligned_range(unsigned long *bitmap,
u32 start, u32 nbits,
int len, int align, u32 skip_mask)
{ … }
u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt,
int align, u32 skip_mask)
{ … }
u32 mlx4_bitmap_avail(struct mlx4_bitmap *bitmap)
{ … }
static u32 mlx4_bitmap_masked_value(struct mlx4_bitmap *bitmap, u32 obj)
{ … }
void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt,
int use_rr)
{ … }
int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask,
u32 reserved_bot, u32 reserved_top)
{ … }
void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap)
{ … }
struct mlx4_zone_allocator { … };
struct mlx4_zone_entry { … };
struct mlx4_zone_allocator *mlx4_zone_allocator_create(enum mlx4_zone_alloc_flags flags)
{ … }
int mlx4_zone_add_one(struct mlx4_zone_allocator *zone_alloc,
struct mlx4_bitmap *bitmap,
u32 flags,
int priority,
int offset,
u32 *puid)
{ … }
static void __mlx4_zone_remove_one_entry(struct mlx4_zone_entry *entry)
{ … }
void mlx4_zone_allocator_destroy(struct mlx4_zone_allocator *zone_alloc)
{ … }
static u32 __mlx4_alloc_from_zone(struct mlx4_zone_entry *zone, int count,
int align, u32 skip_mask, u32 *puid)
{ … }
static void __mlx4_free_from_zone(struct mlx4_zone_entry *zone, u32 obj,
u32 count)
{ … }
static struct mlx4_zone_entry *__mlx4_find_zone_by_uid(
struct mlx4_zone_allocator *zones, u32 uid)
{ … }
struct mlx4_bitmap *mlx4_zone_get_bitmap(struct mlx4_zone_allocator *zones, u32 uid)
{ … }
int mlx4_zone_remove_one(struct mlx4_zone_allocator *zones, u32 uid)
{ … }
static struct mlx4_zone_entry *__mlx4_find_zone_by_uid_unique(
struct mlx4_zone_allocator *zones, u32 obj)
{ … }
u32 mlx4_zone_alloc_entries(struct mlx4_zone_allocator *zones, u32 uid, int count,
int align, u32 skip_mask, u32 *puid)
{ … }
u32 mlx4_zone_free_entries(struct mlx4_zone_allocator *zones, u32 uid, u32 obj, u32 count)
{ … }
u32 mlx4_zone_free_entries_unique(struct mlx4_zone_allocator *zones, u32 obj, u32 count)
{ … }
static int mlx4_buf_direct_alloc(struct mlx4_dev *dev, int size,
struct mlx4_buf *buf)
{ … }
int mlx4_buf_alloc(struct mlx4_dev *dev, int size, int max_direct,
struct mlx4_buf *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
void mlx4_buf_free(struct mlx4_dev *dev, int size, struct mlx4_buf *buf)
{ … }
EXPORT_SYMBOL_GPL(…);
static struct mlx4_db_pgdir *mlx4_alloc_db_pgdir(struct device *dma_device)
{ … }
static int mlx4_alloc_db_from_pgdir(struct mlx4_db_pgdir *pgdir,
struct mlx4_db *db, int order)
{ … }
int mlx4_db_alloc(struct mlx4_dev *dev, struct mlx4_db *db, int order)
{ … }
EXPORT_SYMBOL_GPL(…);
void mlx4_db_free(struct mlx4_dev *dev, struct mlx4_db *db)
{ … }
EXPORT_SYMBOL_GPL(…);
int mlx4_alloc_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres,
int size)
{ … }
EXPORT_SYMBOL_GPL(…);
void mlx4_free_hwq_res(struct mlx4_dev *dev, struct mlx4_hwq_resources *wqres,
int size)
{ … }
EXPORT_SYMBOL_GPL(…);