1 /*
2 * Copyright (c) 2008 Texas Instruments. All rights reserved.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License
5 * v. 1.0 which accompanies this distribution. The Eclipse Public License is
6 * available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
7 * Distribution License is available at
8 * http://www.eclipse.org/org/documents/edl-v10.php.
9 *
10 * Contributors:
11 * Texas Instruments - initial implementation
12 * */
13 /*
14 * ======== ISystemSupport.xdc ========
15 */
16 package xdc.runtime;
17
18 /*!
19 * ======== ISystemSupport ========
20 * Interface to core system functions.
21 *
22 * Each embedded system requires implementations of these functions but
23 * the behavior of these functions varies depending on the context of the
24 * embedded system. For example, some systems will implement `exit()` as
25 * an infinite loop because the executable is designed to *never* exit.
26 */
27 @DirectCall
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(CString 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()}`.
67 *
68 * @see System#atexit
69 */
70 Void exit(Int stat);
71
72 /*!
73 * ======== flush ========
74 * Backend for `{@link System#flush()}`
75 *
76 * This function is simply called by `{@link System#flush System_flush}`
77 * to output any characters buffered by the underlying `SystemSupport`
78 * module to an output device.
79 */
80 Void flush();
81
82 /*!
83 * ======== putch ========
84 * Backend for `{@link System#printf()}` and `{@link System#putch()}`
85 *
86 * Output a single character. This function is called by
87 * `{@link System#printf System_printf()}` to write each character
88 * of formated output specified by its arguments.
89 90 *
91 * @param(ch) character to output
92 */
93 Void putch(Char ch);
94
95 /*!
96 * ======== ready ========
97 * Test if character output can proceed
98 *
99 * This function is called by `{@link System}` prior to performing
100 * any character output. If this function returns `FALSE`, the `System`
101 * functions that would normally call `putch()` simply return
102 * (with an appropriate error status) without ever calling
103 * `{@link #putch}`.
104 */
105 Bool ready();
106 }
107 /*
108 * @(#) xdc.runtime; 2, 1, 0,0; 5-8-2019 15:48:08; /db/ztree/library/trees/xdc/xdc-G16/src/packages/
109 */
110