source: rtems/c/src/lib/libbsp/shared/main.c @ b6394ae

4.104.114.84.95
Last change on this file since b6394ae was 7a75c323, checked in by Joel Sherrill <joel.sherrill@…>, on 04/14/98 at 20:52:31

Removed recursive call to exit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  A simple main which can be used on any embedded target.
3 *
4 *  This style of initialization insures that the C++ global
5 *  constructors are executed after RTEMS is initialized.
6 *
7 *  Thanks to Chris Johns <cjohns@plessey.com.au> for this idea.
8 *
9 *  COPYRIGHT (c) 1989-1998.
10 *  On-Line Applications Research Corporation (OAR).
11 *  Copyright assigned to U.S. Government, 1994.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#include <bsp.h>
21
22char *rtems_progname;
23
24extern void bsp_start( void );
25extern void bsp_cleanup( void );
26
27extern rtems_configuration_table  BSP_Configuration;
28extern rtems_cpu_table            Cpu_table;
29
30rtems_interrupt_level bsp_isr_level;
31
32int main(int argc, char **argv)
33{
34
35  if ((argc > 0) && argv && argv[0])
36    rtems_progname = argv[0];
37  else
38    rtems_progname = "RTEMS";
39
40  rtems_initialize_executive_late( bsp_isr_level );
41
42  return 0;
43}
44
45int boot_card(int argc, char **argv)
46{
47  int status;
48
49  /* the atexit hook will be before the static destructor list's entry
50     point */
51  bsp_start();
52
53  bsp_isr_level =
54    rtems_initialize_executive_early( &BSP_Configuration, &Cpu_table );
55
56  status = main(argc, argv);
57
58  bsp_cleanup(); 
59
60  return status;
61}
62
Note: See TracBrowser for help on using the repository browser.