Dallas Semiconductor DS80C400 C Libraries Home Page

Main Page   Data Structures   File List   Data Fields   Globals  

rom400_kmem.h File Reference


Detailed Description

Kernel Memory initialization functions for the DS80C400 ROM.

This library allows users to allocate different amounts of memory as fast kernel buffers for use as ethernet buffers and as task control structures. The default allocation by the ROM may not be sufficient, and the use of multiple processes and multiple sockets might combine to drain all kernel memory. This library allows you to increase that amount for more complex applications.

There are two ways to use this library. 1) When using init_rom: Call kmem_install before calling init_rom.

2) When using the individual initialization functions: The function kmem_init is meant to replace the function init_km from the initialization library.

For detailed information on the DS80C400 please see the High-Speed Microcontroller User's Guide: DS80C400 Supplement.

The functions in this library are multi-process safe--that is, if you call the same method from two different processes at the same time, the parameters to the function will not be destroyed. However, the function kmem_init is a system initialization function and should only be called once before the process scheduler is active.

Go to the source code of this file.

Defines

#define ROM400_KMEM_VERSION   5
#define ROM400_KMEM_MODEL_SMALLEST   1
#define ROM400_KMEM_MODEL_LARGEST   11

Functions

unsigned char kmem_init (unsigned char MODEL)
 Initializes the kernel buffers.

unsigned int kmem_version (void)
 Returns the version number of this KMEM library.

void kmem_install (unsigned char MODEL)
 Installs the kmem library.


Define Documentation

#define ROM400_KMEM_MODEL_LARGEST   11
 

The largest value of the argument to be passed to kmem_init.

See also:
ROM400_KMEM_MODEL_SMALLEST

kmem_init

#define ROM400_KMEM_MODEL_SMALLEST   1
 

The smallest value of the argument to be passed to kmem_init.

See also:
ROM400_KMEM_MODEL_LARGEST

kmem_init

#define ROM400_KMEM_VERSION   5
 

Version number associated with this header file. Should be the same as the version number returned by the kmem_version function.

See also:
kmem_version


Function Documentation

unsigned char kmem_init unsigned char    MODEL
 

Initializes the kernel buffers.

Allows user applications to specify the amount of kernel memory that will be available to the system. Kernel memory is used internally for Ethernet buffers and task control structures, and as such can limit the number of processes or sockets an application can use concurrently if there is not enough kernel buffer space. The default kernel buffer allocation given by the ROM is:

  • 90 byte buffers (20 count)
  • 256 byte buffers (2 count)
  • 512 byte buffers (1 count)
  • 768 byte buffers (1 count)
  • 1024 byte buffers (1 count)
  • 1280 byte buffers (1 count)
  • 1600 byte buffers (2 count)

By calling this function, the count of kernel buffers is multiplied by the value MODEL. Note that while ROM400_KMEM_MODEL_LARGEST is the largest amount of kernel memory that the system can support, few applications will need to go beyond ROM400_KMEM_MODEL_SMALLEST + 2.

Parameters:
MODEL specifies how much kernel memory will be allocated for the system
Returns:
0 for success, non-zero for failure.
See also:
init_rom

void kmem_install unsigned char    MODEL
 

Installs the kmem library.

This function must be called before init_rom.

Allows user applications to specify the amount of kernel memory that will be available to the system. Kernel memory is used internally for Ethernet buffers and task control structures, and as such can limit the number of processes or sockets an application can use concurrently if there is not enough kernel buffer space. The default kernel buffer allocation given by the ROM is:

  • 90 byte buffers (20 count)
  • 256 byte buffers (2 count)
  • 512 byte buffers (1 count)
  • 768 byte buffers (1 count)
  • 1024 byte buffers (1 count)
  • 1280 byte buffers (1 count)
  • 1600 byte buffers (2 count)

By calling this function, the count of kernel buffers is multiplied by the value MODEL. Note that while ROM400_KMEM_MODEL_LARGEST is the largest amount of kernel memory that the system can support, few applications will need to go beyond ROM400_KMEM_MODEL_SMALLEST + 2.

Parameters:
MODEL specifies how much kernel memory will be allocated for the system
See also:
init_rom

unsigned int kmem_version void   
 

Returns the version number of this KMEM library.

Returns:
Version number of this KMEM library.


Copyright 2004 Dallas Semiconductor, Inc.. Documentation generated by Doxygen.