EasyManuals Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #44 background imageLoading...
Page #44 background image
Configuring DSP/BIOS Applications Statically
2-14
Declare static objects with the far keyword. The DSP/BIOS compiler
supports this common extension to the C language. The far keyword in a
data declaration indicates that the data is not in the .bss section.
For example, to reference a PIP object called inputObj that was created
statically, declare the object as follows:
extern far PIP_Obj inputObj;
if (PIP_getReaderNumFrames(&inputObj)) {
. . .
}
Create and initialize a global object pointer. You can create a global
variable that is initialized to the address of the object you want to
reference. All references to the object must be made using this pointer,
to avoid the need for the far keyword. For example:
extern PIP_Obj inputObj;
/* input MUST be a global variable */
PIP_Obj *input = &inputObj;
if (PIP_getReaderNumFrames(input)) {
. . .
}
Declaring and initializing the global pointer consumes an additional word
of data (to hold the 32-bit address of the object).
Also, if the pointer is a static or automatic variable this technique fails.
The following code does not operate as expected when compiled using
the small model:
extern PIP_Obj inputObj;
static PIP_Obj *input = &inputObj; /* ERROR!!!! */
if (PIP_getReaderNumFrames(input)) {
. . .
}
Place all objects adjacent to .bss. If all objects are placed at the end of
the .bss section, and the combined length of the objects and the .bss data
is less than 32K bytes, you can reference these objects as if they were
allocated within the .bss section:
extern PIP_Obj inputObj;
if (PIP_getReaderNumFrames(&inputObj)) {
. . .
}
You can guarantee this placement of objects by using the configuration
as follows:

Table of Contents

Other manuals for Texas Instruments TMS320

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Related product manuals