1 2 3 4 5 6 7 8 9 10 11 12
13 14 15 16
17 package xdc.runtime;
18
19 /*!
20 * ======== ISystemSupport ========
21 * Interface to core system functions.
22 *
23 * Each embedded system requires implementations of these functions but
24 * the behavior of these functions varies depending on the context of the
25 * embedded system. For example, some systems will implement `exit()` as
26 * an infinite loop because the executable is designed to *never* exit.
27 */
28 interface ISystemSupport {
29
30 /*!
31 * ======== abort ========
32 * Backend for `{@link System#abort()}`
33 *
34 * This function is called by `{@link System#abort()}` prior to calling
35 * the ANSI C Standard library function `abort()`. So, to ensure the
36 * abort processing of the system's ANSI C Standard library completes,
37 * this function should return to its caller.
38 *
39 * @param(str) message to output just prior to aborting
40 *
41 * If non-`NULL`, this string should be output just prior to
42 * terminating.
43 */
44 Void abort(String str);
45
46 /*!
47 * ======== exit ========
48 * Backend for `{@link System#exit()}`
49 *
50 * This function is called as part the normal "atexit" processing
51 * performed by the ANSI C Standard Library's `exit()` function;
52 * `{@link System#exit()}` directly calls ANSI `exit()`.
53 *
54 * This function is called after all "atexit" handlers bound via
55 * `{@link System#atexit()}` are run and it
56 * is always called while "inside" the the `System` gate.
57 *
58 * To ensure that all exit processing of the system's ANSI C
59 * Standard Library completes, this function should return to its caller.
60 * Exit handlers bound using the ANSI C Standard Library `atexit()`
61 * function may run before or after this function.
62 *
63 * @param(stat) status value passed to all "atexit" handlers
64 *
65 * This value is passed to all "atexit" handles bound via
66 * `{@link System#atexit()}`. If the application exits via the
67 * ANSI C Standard `exit()` function rather than via System_exit(),
68 * `stat` will be equal to `{@link System#STATUS_UNKNOWN}`.
69 *
70 * @see System#atexit
71 */
72 Void exit(Int stat);
73
74 /*!
75 * ======== flush ========
76 * Backend for `{@link System#flush()}`
77 *
78 * This function is simply called by `{@link System#flush System_flush}`
79 * to output any characters buffered by the underlying `SystemSupport`
80 * module to an output device.
81 */
82 Void flush();
83
84 /*!
85 * ======== putch ========
86 * Backend for `{@link System#printf()}` and `{@link System#putch()}`
87 *
88 * Output a single character. This function is called by
89 * `{@link System#printf System_printf()}` to write each character
90 * of formated output specified by its arguments.
91
92 *
93 * @param(ch) character to output
94 */
95 Void putch(Char ch);
96
97 /*!
98 * ======== ready ========
99 * Test if character output can proceed
100 *
101 * This function is called by `{@link System}` prior to performing
102 * any character output . If this function returns `FALSE`, the `System`
103 * functions that would normally call `putch()` simply return
104 * (with an appropriate error status) without ever calling
105 * `{@link #putch}`.
106 */
107 Bool ready();
108 }
109 110 111
112