Intel® IXP400 Software

Operating System Abstraction Layer (OSAL)

24.6.2Buffer Management Module

This module defines a memory buffer structure and functions for creating and managing buffer pools.

Table 63 provides an overview of the buffer management module.

Table 63. OSAL Buffer Management Interface

 

Types

IX_OSAL_MBUF

memory buffer

 

 

 

 

IX_OSAL_MBUF_POOL

memory buffer pool

 

 

 

 

 

 

ixOsalPoolInit

initializes pool with memory allocation

 

Functions

ixOsalNoAllocPoolInit

initializes pool without memory allocation

 

ixOsalMbufAlloc

allocates a buffer from a pool

 

ixOsalMbufFree

frees a buffer into its pool

 

ixOsalMbufChainFree

frees a buffer chain into its pool

 

 

ixOsalMbufDataPtrReset

resets the buffer data pointer

 

 

ixOsalPoolShow

displays pool statistics

24.6.3I/O Memory and Endianness Support Module

The OSAL I/O Memory Management and Endianness Support Module implements:

I/O memory management

Big and little endian support

I/O memory management defines a set of macros allowing the user to gain and release access to memory-mapped I/O in an operating-system-independent fashion. Depending on the target platform and OS, gaining access can vary between statically mapped I/O to dynamically mapped I/O through OS-specific functions (for example, ioremap() in Linux).

Using a global memory map, which defines the specifics of each memory map cell (for example, UART registers), the access of I/O memory can be abstracted independent of operating systems, dynamic mapping, or endianness-dependent virtual memory locations. This functionality makes the code far more portable across different operating systems and platforms.

Wind River* VxWorks OS maintains a 1:1 virtual to physical mapping. However, this is not the case in other OS such as Linux . The OSAL layer provides a portable approach that involves mapping the memory when the software is initialized to access the desired memory and unmapping the memory when the software unloads. Depending upon the build for a particular OS (and if the memory is not statically mapped), the OSAL can create MMU entries to map the specified physical address in the usable memory range.

Additionally, the mapping automatically considers the endianness type in systems that can use mixed endian modes (such as the IXP4XX product line and IXC1100 control plane processors). This behavior is controlled by two defines which have to be supplied by the software using these methods: IX__OSAL_COMPONENT_MAPPING and IX_OSAL_MEM_MAP_TYPE.

April 2005

IXP400 Software Version 2.0

Programmer’s Guide

322

Document Number: 252539, Revision: 007

 

Page 322
Image 322
Intel IXP400 Buffer Management Module, 24.6.3 I/O Memory and Endianness Support Module, Osal Buffer Management Interface