RTEMS Logo

RTEMS 4.6.0 On-Line Library


Memory Model Small Memory Model

PREV UP NEXT Bookshelf RTEMS TI C3x/C4x Applications Supplement

3.4.1: Small Memory Model

The small memory model is the simplest and most efficient. However, it includes a limitation that make it inappropriate for numerous applications. The small memory model assumes that the application needs to access no more than 64K words. Thus the dp register can be loaded at application start time and never reloaded. Thus the compiler will not even generate instructions to load the dp.

This can significantly reduce the code space required by an application but the application is limited in the amount of data it can access.

With the GNU Compiler Suite, small memory model is selected by invoking the compiler with either the -msmall or -msmallmemoryXXX argument. This argument must be included when linking the application in order to ensure that support libraries also compiled for the large memory model are used. The default memory model is XXX.

When this memory model is selected, the XXX symbol is predefined by the C and C++ compilers and the XXX symbol is predefined by the assembler. This behavior is the same for the GNU and Texas Instruments toolsets. RTEMS uses these predefines to determine the proper handling of the dp register in those C3x/C4x specific routines that were written in assembly language.


PREV UP NEXT Bookshelf RTEMS TI C3x/C4x Applications Supplement

Copyright © 1988-2004 OAR Corporation