The NOINDIRECTCALL directive causes the linker to exclude entries in the inter-bank call table for indirect function calls. This directive is useful if your application uses tables of function pointers that are accessed from and within the same code bank (in a manner that requires no bankswitching). In code banking applications, the linker creates an entry in the inter-bank call table for each function that is called indirectly (via a function pointer). This is done to ensure that functions which are invoked indirectly are available to all code banks. The NOINDIRECTCALL directive works only for function tables and not for function pointer references within a function. For example: Common Area Module
extern void id_call (void (* f) ());
extern void funca (void);
extern void funcb (void);
extern void funcc (void);
void (*f[])(void) = { func2a, func2b };
void test (void) {
id_call (f[0]);
id_call (f[1]);
id_call (func2c); // This always generates an inter-bank table entry.
}
Code Bank Module
void funca () {
;
}
void funcb () {
;
}
void funcc () {
;
}
void id_call (void (* f) ()) {
f ();
}
Use the NOINDIRECTCALL directive to avoid inter-bank table entries for funca and funcb. |