Intel® IXP400 Software

Operating System Abstraction Layer (OSAL)

24.4.1Backward Compatibility Module

The OSAL layer was developed during IXP400 software v1.5 development and provides backward compatibility to IXP400 software releases prior to v1.5. To minimize the code change to the current IXP400 software code base, the OSAL layer provides support for major ossl/osServices APIs used in v1.4. Users are strongly recommended to use the OSAL APIs for compatibility with future versions.

The ossl/osServices APIs are still supported in software release 2.0. For example, ixOsServMutexInit will be mapped to ixOsalMutexInit. Intel® IXP400 Software v2.0 continues to provide support for v1.4 ossl/osServices APIs. However, to receive backward compatibility support, users must continue to include 1.4 headers (IxOsServices.h, IxOsCacheMMU.h, etc.) to be able to use the ossl/osServices APIs. The API calls to ossl/osServices components have been mapped (by a mapping module) to the OSAL component. By declaring dependency on ossl/ osServices as described above, all calls to v1.4 ossl/osServices will be re-routed to Intel® IXP400 Software v2.0 OSAL APIs.

The MBUF macros are still supported in Intel® IXP400 Software v2.0; for example,

IX_MBUF_MDATA, IX_MBUF_MLEN, etc. The OSAL will map these macros to the current OSAL IXP_BUF macros.

24.4.2Buffer Translation Module

OSAL provides buffer translation macros for users to translate OS-specific buffer formats to OSAL IXP buffer format and vice versa. The buffer translations is usually done in the driver component. However, for ease of use, the OSAL layer provides generic macros for the VxWorks*, and Linux* operating systems. Depending upon the build, the OSAL layer will translate the macros to its OS- specific implementation. The general syntax for using these macros is as follows:

IX_OSAL_CONVERT_OSBUF_TO_IXPBUF(osBufPtr,ixpBufPtr)

IX_OSAL_CONVERT_IXPBUF_TO_OS_BUF(ixpBufPtr,osBufPtr)

These macros are intended to replace Linux* skbuf conversion, and VxWorks* mbuf conversions. Users can also define their own conversion utilities in their package to translate their buffers to the OSAL IXP_BUF (IX_OSAL_MBUF). As an option to using the translation functions, the user can choose to implement their own definitions for the ix_mbuf structure field within the IXP_BUF structure format.

24.5OSAL Library Structure

As shown in Figure 106, the OSAL library is contained in the following directories along with a “doc” folder that includes API references in HTML and PDF format.

The “include” directory

The Include directory contains the main OSAL header files for core module and subdirectories for module-specific header files (for example, header files for the Buffer Management module grouped under the “include/modules/bufferMgt” subdirectory). It also contains subdirectories for platform-specific headers (for example, header for the ixp400 platform grouped under “include/ platforms/ixp400” subdirectory). The OSAL library is accessed via a single header file — IxOsal.h. The main header file will automatically include the core API and the OSAL

April 2005

IXP400 Software Version 2.0

Programmer’s Guide

316

Document Number: 252539, Revision: 007

 

Page 316
Image 316
Intel IXP400 manual Osal Library Structure, Backward Compatibility Module, Buffer Translation Module