summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/unix/posix/startup/main.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-05-22 11:03:03 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-05-22 11:03:03 +0000
commit9d09d138082b61e001fdca1b547a70aab36a25ed (patch)
tree536f37938613456e2f8e805a67114785b6370385 /c/src/lib/libbsp/unix/posix/startup/main.c
parentchanged version to 980521 (diff)
downloadrtems-9d09d138082b61e001fdca1b547a70aab36a25ed.tar.bz2
Added main() which did not require C++ support. A different main
is used based on whether C++ is enabled or disabled.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/unix/posix/startup/main.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/unix/posix/startup/main.c b/c/src/lib/libbsp/unix/posix/startup/main.c
new file mode 100644
index 0000000000..520cd36b04
--- /dev/null
+++ b/c/src/lib/libbsp/unix/posix/startup/main.c
@@ -0,0 +1,54 @@
+/*
+ * Description:
+ * This file exists solely to (try to) ensure RTEMS is initialized.
+ * It is not to be used in systems which want C++ support.
+ *
+ * $Id$
+ */
+
+#include <bsp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*
+ * RTEMS program name
+ * Probably not used by anyone, but it is nice to have it.
+ * Actually the UNIX version of CPU_INVOKE_DEBUGGER will probably
+ * need to use it
+ */
+
+char *rtems_progname;
+
+int main(
+ int argc,
+ char **argv
+)
+{
+ rtems_argc = argc;
+ rtems_argv = argv;
+
+ bsp_start();
+
+ if ((argc > 0) && argv && argv[0])
+ rtems_progname = argv[0];
+ else
+ rtems_progname = "RTEMS";
+
+ /*
+ * Start multitasking
+ */
+
+ rtems_initialize_executive_late( bsp_isr_level );
+
+ /*
+ * Returns when multitasking is stopped
+ * This allows our destructors to get run normally
+ */
+
+ fflush( stdout );
+ fflush( stderr );
+
+ bsp_cleanup();
+
+ return 0;
+}