From RTSC-Pedia
revision tip
LANDSCAPE orientationC - Module startup
Module's startup initialization function
Synopsis
| #include "package/internal/«Mod».xdc.h"
Int «Mod»_Module_startup(Int state); |
Parameters
- state
- this parameter serves as "state variable" whose initial value will be Startup_NOTDONE (0) and whose final value will eventually be Startup_DONE (-1). If startup() returns a value other than Startup_DONE, it will be called in a subsequent pass with this return value passed in as the value of state. To ensure this process terminates, no startup function is ever called more than xdc.runtime.Startup.maxPasses times.
Description
Modules that have the @ModuleStartup attribute must implement this startup function, where «Mod» is the name of the module requesting startup support.
For situations in which the startup of one module depends upon another having completed its startup processing, a «Mod»_Module_startupDone() function is also defined, where «Mod» is the name of some module or proxy. These predicates can be used as guards inside of a startup function to probe whether a particular module has completed its own startup processing. As a convenience, the function Startup_rtsDone() probes the necessary set of xdc.runtime modules required to support a module instance create, and should be called before any startup-time instance creation and/or memory allocation is performed.
| Int «Mod»_Module_startup(Int state)
{
if (!Startup_rtsDone()) {
return (Startup_NOTDONE);
}
:
return (Startup_DONE);
} |
See also
Copyright © 2008 The Eclipse Foundation. All Rights Reserved