Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Variables
cvmx-fpa.h File Reference
#include <asm/octeon/cvmx-address.h>
#include <asm/octeon/cvmx-fpa-defs.h>

Go to the source code of this file.

Data Structures

union  cvmx_fpa_iobdma_data_t
 
struct  cvmx_fpa_pool_info_t
 

Macros

#define CVMX_FPA_NUM_POOLS   8
 
#define CVMX_FPA_MIN_BLOCK_SIZE   128
 
#define CVMX_FPA_ALIGNMENT   128
 

Functions

: Constant character string to name this pool.

Setup a FPA pool to control a new block of memory. This can only be called once per pool. Make sure proper locking enforces this.

: Pool to initialize 0 <= pool < 8

String is not copied. : Pointer to the block of memory to use. This must be accessible by all processors and external hardware. : Size for each block controlled by the FPA : Number of blocks

Returns 0 on Success, -1 on failure

int cvmx_fpa_setup_pool (uint64_t pool, const char *name, void *buffer, uint64_t block_size, uint64_t num_blocks)
 
uint64_t cvmx_fpa_shutdown_pool (uint64_t pool)
 
uint64_t cvmx_fpa_get_block_size (uint64_t pool)
 

Variables

cvmx_fpa_pool_info_t cvmx_fpa_pool_info [CVMX_FPA_NUM_POOLS]
 

Detailed Description

Interface to the hardware Free Pool Allocator.

Definition in file cvmx-fpa.h.

Macro Definition Documentation

#define CVMX_FPA_ALIGNMENT   128

Definition at line 44 of file cvmx-fpa.h.

#define CVMX_FPA_MIN_BLOCK_SIZE   128

Definition at line 43 of file cvmx-fpa.h.

#define CVMX_FPA_NUM_POOLS   8

Definition at line 42 of file cvmx-fpa.h.

Function Documentation

uint64_t cvmx_fpa_get_block_size ( uint64_t  pool)

Get the size of blocks controlled by the pool This is resolved to a constant at compile time.

: Pool to access Returns Size of the block in bytes

int cvmx_fpa_setup_pool ( uint64_t  pool,
const char name,
void buffer,
uint64_t  block_size,
uint64_t  num_blocks 
)
uint64_t cvmx_fpa_shutdown_pool ( uint64_t  pool)

Shutdown a Memory pool and validate that it had all of the buffers originally placed in it. This should only be called by one processor after all hardware has finished using the pool.

: Pool to shutdown Returns Zero on success

  • Positive is count of missing buffers
  • Negative is too many buffers or corrupted pointers

Variable Documentation

Current state of all the pools. Use access functions instead of using it directly.