|
2
|
1 //======================================================================== |
|
|
2 // |
|
|
3 // pkgstart.cxx |
|
|
4 // |
|
|
5 // General startup code for the target machine |
|
|
6 // |
|
|
7 //======================================================================== |
|
|
8 //####COPYRIGHTBEGIN#### |
|
|
9 // |
|
|
10 // ------------------------------------------- |
|
|
11 // The contents of this file are subject to the Cygnus eCos Public License |
|
|
12 // Version 1.0 (the "License"); you may not use this file except in |
|
|
13 // compliance with the License. You may obtain a copy of the License at |
|
|
14 // http://sourceware.cygnus.com/ecos |
|
|
15 // |
|
|
16 // Software distributed under the License is distributed on an "AS IS" |
|
|
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
|
|
18 // License for the specific language governing rights and limitations under |
|
|
19 // the License. |
|
|
20 // |
|
|
21 // The Original Code is eCos - Embedded Cygnus Operating System, released |
|
|
22 // September 30, 1998. |
|
|
23 // |
|
|
24 // The Initial Developer of the Original Code is Cygnus. Portions created |
|
|
25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
|
|
26 // ------------------------------------------- |
|
|
27 // |
|
|
28 //####COPYRIGHTEND#### |
|
|
29 //======================================================================== |
|
|
30 //#####DESCRIPTIONBEGIN#### |
|
|
31 // |
|
|
32 // Author(s): jlarmour |
|
|
33 // Contributors: jlarmour |
|
|
34 // Date: 1999-01-21 |
|
|
35 // Purpose: This provides generic startup code for the eCos system. |
|
|
36 // Description: We start the system with the entry point cyg_start() |
|
|
37 // which is called from the eCos HALs. This in turn invokes |
|
|
38 // cyg_prestart(), cyg_package_start() and cyg_user_start(). |
|
|
39 // All these can be overriden by the user. |
|
|
40 // Usage: Override the defaults to use your own startup code. |
|
|
41 // cyg_package_start() is used to call into individual |
|
|
42 // packages' startup code. Alternatively leave it be and |
|
|
43 // use the configuration options to set the appropriate |
|
|
44 // compatibility environment e.g. uItron, ISO C, etc. |
|
|
45 // This may be automatically generated in the future. |
|
|
46 // |
|
|
47 //####DESCRIPTIONEND#### |
|
|
48 // |
|
|
49 //======================================================================== |
|
|
50 |
|
|
51 // CONFIGURATION |
|
|
52 |
|
|
53 #include <pkgconf/infra.h> // Configuration header |
|
|
54 |
|
|
55 // INCLUDES |
|
|
56 |
|
|
57 #include <cyg/infra/cyg_type.h> // Common type definitions and support |
|
|
58 #include <cyg/infra/cyg_trac.h> // Default tracing support |
|
|
59 |
|
|
60 #ifdef CYGSEM_START_ISO_C_COMPATIBILITY |
|
|
61 # include <sys/cstartup.h> |
|
|
62 #endif |
|
|
63 |
|
|
64 #ifdef CYGSEM_START_UITRON_COMPATIBILITY |
|
|
65 # include <cyg/compat/uitron/uit_func.h> |
|
|
66 #endif |
|
|
67 |
|
|
68 // FUNCTION PROTOTYPES |
|
|
69 |
|
|
70 externC void |
|
|
71 cyg_package_start( void ) CYGBLD_ATTRIB_WEAK; |
|
|
72 |
|
|
73 // FUNCTIONS |
|
|
74 |
|
|
75 void |
|
|
76 cyg_package_start( void ) |
|
|
77 { |
|
|
78 CYG_REPORT_FUNCTION(); |
|
|
79 CYG_REPORT_FUNCARGVOID(); |
|
|
80 |
|
|
81 CYG_TRACE0( true, "This is the system default cyg_package_start()" ); |
|
|
82 |
|
|
83 #ifdef CYGSEM_START_UITRON_COMPATIBILITY |
|
|
84 cyg_uitron_start(); |
|
|
85 #endif |
|
|
86 |
|
|
87 #ifdef CYGSEM_START_ISO_C_COMPATIBILITY |
|
|
88 // This works even if the kernel is there, but if not, then it |
|
|
89 // calls the user main() and doesn't return until it does! |
|
|
90 cyg_iso_c_start(); |
|
|
91 #endif |
|
|
92 |
|
|
93 CYG_EMPTY_STATEMENT; // don't let it complain about doing nothing |
|
|
94 |
|
|
95 CYG_REPORT_RETURN(); |
|
|
96 } // cyg_package_start() |
|
|
97 |
|
|
98 // EOF pkgstart.cxx |