02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents<br />

7.3.3 System Configuration ........................................................................ 147<br />

Configuring the Host System ........................................................... 147<br />

Configuring the Target Hardware ................................................... 147<br />

Configuring VxWorks ....................................................................... 148<br />

Configuring the <strong>BSP</strong> VTS .................................................................. 149<br />

7.4 Running the <strong>BSP</strong> VTS ...................................................................................... 153<br />

7.4.1 Starting the <strong>BSP</strong> VTS ......................................................................... 153<br />

7.4.2 Monitoring a <strong>BSP</strong> Test ....................................................................... 155<br />

8 Writing Portable C Code .......................................................................................... 159<br />

Background ......................................................................................... 159<br />

8.1 Portable C Code ................................................................................................ 160<br />

8.1.1 Data Structures ................................................................................... 160<br />

Specify Field Widths .......................................................................... 161<br />

Avoid Bit Fields .................................................................................. 161<br />

8.1.2 In-Line Assembly ............................................................................... 162<br />

8.1.3 Static Data Alignment ....................................................................... 163<br />

8.1.4 Runtime Alignment Checking ......................................................... 163<br />

Checking the Alignment of a Data Item ......................................... 163<br />

Verifying Pointer Alignment ............................................................ 163<br />

Unaligned Accesses and Copying ................................................... 164<br />

8.1.5 Other Issues ........................................................................................ 165<br />

Follow Strict ANSI Compilation ...................................................... 165<br />

Remove Compiler Warnings ............................................................ 165<br />

Avoid Use of Casts ............................................................................. 165<br />

Avoid inline Keyword ....................................................................... 165<br />

Avoid alloca( ) Function .................................................................... 166<br />

Take Care with void Pointer Arithmetic ......................................... 166<br />

Use volatile and const Attributes .................................................... 167<br />

Misuse of the register Attribute ....................................................... 167<br />

Avoid vector Name ............................................................................ 167<br />

Statement Labels ................................................................................ 168<br />

Summary of Compiler Macros ......................................................... 168<br />

xi

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!