Changes between Version 1 and Version 2 of TBR/UserManual/Using_C_Plus_Plus


Ignore:
Timestamp:
10/21/05 19:38:25 (19 years ago)
Author:
JoelSherrill
Comment:

/* Global Object Construction and Destruction */ Coorrect comment.

Legend:

Unmodified
Added
Removed
Modified
  • TBR/UserManual/Using_C_Plus_Plus

    v1 v2  
    2929Global object construction requires the compiler and RTEMS work together. This is a constant source of maintenance issues as changes in one can effect the other. The compiler generates special code to construct and destruct each global object. The constructor and desctructor pointer's to this code is placed in a special section, usually called .ctor and .dtor. The linker will pull all the pointers into a single section giving you a table of pointers to constructors and destructors. The order or placement of a specific pointer in these tables cannot be easily set and any application that relies on a specific order should be considered broken and needs to be fixed.
    3030
    31 RTEMS calls the constructors after the kernel is running, but before first '''Init''' task runs. This means global objects can allocation memory from the heap, create threads and semaphores.
    32 
    33   '''''Note''': Does this happen in the context of the Init task or the BSP context ?''
     31RTEMS calls the constructors after the kernel is running, but before first '''Init''' task runs. This means global objects can allocation memory from the heap, create threads and semaphores.  This runs in the context of the Init task before its entry point is invoked.  See _Thread_Handler() for details.
    3432
    3533Different processors can require different initialisation sequences. An example is the PowerPC and its support for the SYSV/EABI compliant environment.