I want to place a function
Код: Выделить всё
void loadableSW (void)
Код: Выделить всё
0x3FF802
Код: Выделить всё
residentMain()
Код: Выделить всё
loadableSW
Код: Выделить всё
residentMain
Update: Target hardware is TMS320C620xDSP. Since this is an aerospace project, deterministic behaviour is a desirable design objective. Ideally, they would like to know what portion of memory contains what at a particular time. The solution as I just got to know is to define a section in memory in the linker file. The section shall start at
Код: Выделить всё
0x3FF802
Код: Выделить всё
loadableSW
Код: Выделить всё
#pragma CODESECTION ("function_name", "section_name")
Since
Код: Выделить всё
pragma
Besides I am curious. Is there any placement syntax for functions in C++? I know there is one for objects, but functions?
Код: Выделить всё
void residentMain (void) { void (*loadable_p) (void) = (void (*) (void)) 0x3FF802; int hardwareOK = 0; /*Code to check hardware integrity. hardwareOK = 1 if success*/ if (hardwareOK) { loadable_p (); /*Jump to Loadable Software*/ } else { dspHalt (); } }
Источник: https://stackoverflow.com/questions/197 ... ing-pragma