1 /*!
2 * ======== Reset ========
3 * Startup reset function manager
4 *
5 * This module defines an initial reset function and can be used without
6 * requiring any other `xdc.runtime` module. The reset function is called
7 * as early as possible in the application startup and is intended for
8 * platform-specific hardware initialization.
9 *
10 * The reset function sequentially calls each of the functions added to the
11 * `{@link #fxns}` array starting from index 0. If
12 * `{@link Startup#resetFxn Startup.resetFxn}` is defined, it is called
13 * before any of the functions defined by the `fxns` array.
14 *
15 * By providing an array of startup functions, rather than a single function
16 * as `{@ilnk Startup}` does, modules that need very early initialization
17 * can simply add their initialization to the list of functions to be called
18 * without having to implement a "chaining" mechanism or requiring the user
19 * to implement and maintain an application reset function.
20 *
21 * @a(Warning) 22 * The reset function is _not_ supported on all platforms and, as a result,
23 * you should never place any "portable" code that is required for your
24 * application in this function. Use the `@{link Startup}` module to
25 * define required application startup functions.
26 *
27 * @see Startup
28 */
29 @Template("xdc/runtime/Reset.xdt")
30 metaonlymodule Reset
31 {
32 /*!
33 * ======== fxns ========
34 * List of functions to call at reset
35 *
36 * This array defines the functions that will be executed by the reset
37 * initialization function (`xdc_runtime_Startup_reset__I`) _in addition
38 * to_ the function specified by `@{link Startup#resetFxn}`.
39 *
40 * The following code fragment shows how to add the externally defined
41 * function `myReset()` to this array.
42 * @p(code) 43 * var Reset = xdc.useModule("xdc.runtime.Reset");
44 * Reset.fxns[Reset.fxns.length++] = "&myReset";
45 * @p 46 *
47 * @a(Warning) 48 * Although the functions specified in `fxns[]` are ordinary C functions,
49 * they are often called _before_ the C runtime is fully initialized;
50 * e.g., they may be called _before_ static variables are initialized.
51 * Reset functions should only assume that a minimal execution stack has
52 * initialized.
53 *
54 * @see Startup#resetFxn
55 */
56 metaonlyconfig xdc.runtime.Startup.InitFxn fxns[] = [];
57 }
58 /*
59 * @(#) xdc.runtime; 2, 1, 0,337; 6-14-2011 11:49:32; /db/ztree/library/trees/xdc/xdc-x14x/src/packages/
60 */
61