RAM 6.0 BUX II Series Guía de usuario Pagina 132

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 189
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 131
VxWorks
BSP Developer’s Guide, 6.0
124
If you are not sure if a particular block of code is included in the final image, you
can use the #warning macro to determine what components are included at
compile time. When the compiler’s preprocessor encounters the #warning macro
in an area of code included in the compilation, it prints the message following the
the #warning keyword.
For example, to see if memory auto-sizing is enabled, the code in
sysPhysMemTop( ) in sysLib.c can include the following:
#ifdef LOCAL_MEM_AUTOSIZE
/* To Do Auto-Sizeing stuff */
/* This BSP does not support auto-sizing */
#warning We should NOT do auto-sizing
#else /* not LOCAL_MEM_AUTOSIZE */
/* Don’t do auto-sizing, use defined constants. */
#warning We should be here.
sysPhysMemSize = (char *)(LOCAL_MEM_LOCAL_ADRS + LOCAL_MEM_SIZE);
#endif /* LOCAL_MEM_AUTOSIZE */
Upon building the code, you may see output similar to the following:
ccppc -mcpu=603 -mstrict-align -ansi -O2 -fvolatile -fno-builtin \
-Wall -I/h -I. -IC:\T22\ppc\target\config\all \
-IC:\T22\ppc\target/h -IC:\T22\ppc\target/src/config \
-IC:\T22\ppc\target/src/drv -DCPU=PPC603 -DTOOL_FAMILY=gnu \
-DTOOL=gnu-c sysLib.c
sysLib.c:528: warning: #warning We should be here.
This method is helpful when you are not sure if a component is being included or
not. Another option is to generate the post-processed compiler output and
examine it (for more information on this method, see Post-Processed Compiler
Output, p.123). This is helpful to confirm that an expected include file is being
picked up before another include file.
NOTE: You must set up the VxWorks environment variables in order to run the
tools specified below. The easiest way to do this is to use the configuration script
created during your installation. For VxWorks 6.0, this is the wrEnv script. For
previous versions of VxWorks, this is the torVars script. The configuration script is
located in installDir/host/hostType/bin for all VxWorks versions.
Vista de pagina 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 188 189

Comentarios a estos manuales

Sin comentarios