summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/i386/force386/console/console.c4
-rw-r--r--c/src/lib/libbsp/i386/force386/startup/bspstart.c35
-rw-r--r--c/src/lib/libbsp/i386/go32/console/console.c4
-rw-r--r--c/src/lib/libbsp/i386/go32/startup/bspstart.c37
4 files changed, 67 insertions, 13 deletions
diff --git a/c/src/lib/libbsp/i386/force386/console/console.c b/c/src/lib/libbsp/i386/force386/console/console.c
index 2b68f329c0..f3932150bf 100644
--- a/c/src/lib/libbsp/i386/force386/console/console.c
+++ b/c/src/lib/libbsp/i386/force386/console/console.c
@@ -266,7 +266,9 @@ rtems_device_driver console_write(
}
outbyte( buffer[ count ] );
}
- return maximum;
+
+ rw_args->bytes_moved = maximum;
+ return 0;
}
/*
diff --git a/c/src/lib/libbsp/i386/force386/startup/bspstart.c b/c/src/lib/libbsp/i386/force386/startup/bspstart.c
index 19cb28e450..1433e5e02a 100644
--- a/c/src/lib/libbsp/i386/force386/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/force386/startup/bspstart.c
@@ -74,16 +74,41 @@ void bsp_libc_init()
libc_init(1); /* reentrant if possible */
else
libc_init(0); /* non-reentrant */
+}
+/*
+ * Function: bsp_pretasking_hook
+ * Created: 95/03/10
+ *
+ * Description:
+ * BSP pretasking hook. Called just before drivers are initialized.
+ * Used to setup libc and install any BSP extensions.
+ *
+ * NOTES:
+ * Must not use libc (to do io) from here, since drivers are
+ * not yet initialized.
+ *
+ */
+
+void
+bsp_pretasking_hook(void)
+{
+ bsp_libc_init();
+
+#ifdef STACK_CHECKER_ON
/*
* Initialize the stack bounds checker
+ * We can either turn it on here or from the app.
*/
-
-#ifdef STACK_CHECKER_ON
+
Stack_check_Initialize();
#endif
-
+
+#ifdef RTEMS_DEBUG
+ rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
+#endif
}
+
/*
* After drivers are setup, register some "filenames"
@@ -135,9 +160,9 @@ int main(
* we do not use the pretasking_hook.
*/
- Cpu_table.pretasking_hook = NULL;
+ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
- Cpu_table.predriver_hook = bsp_libc_init; /* RTEMS resources available */
+ Cpu_table.predriver_hook = NULL;
Cpu_table.postdriver_hook = bsp_postdriver_hook;
diff --git a/c/src/lib/libbsp/i386/go32/console/console.c b/c/src/lib/libbsp/i386/go32/console/console.c
index 3265f46de0..0649326846 100644
--- a/c/src/lib/libbsp/i386/go32/console/console.c
+++ b/c/src/lib/libbsp/i386/go32/console/console.c
@@ -237,7 +237,9 @@ rtems_device_driver console_write(
}
outbyte( buffer[ count ] );
}
- return maximum;
+
+ rw_args->bytes_moved = maximum;
+ return 0;
}
/*
diff --git a/c/src/lib/libbsp/i386/go32/startup/bspstart.c b/c/src/lib/libbsp/i386/go32/startup/bspstart.c
index 940c04270a..17a10b4193 100644
--- a/c/src/lib/libbsp/i386/go32/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/go32/startup/bspstart.c
@@ -81,17 +81,42 @@ void bsp_libc_init()
libc_init(1); /* reentrant if possible */
else
libc_init(0); /* non-reentrant */
-
+}
+
+/*
+ * Function: bsp_pretasking_hook
+ * Created: 95/03/10
+ *
+ * Description:
+ * BSP pretasking hook. Called just before drivers are initialized.
+ * Used to setup libc and install any BSP extensions.
+ *
+ * NOTES:
+ * Must not use libc (to do io) from here, since drivers are
+ * not yet initialized.
+ *
+ */
+
+void
+bsp_pretasking_hook(void)
+{
+ bsp_libc_init();
+
+#ifdef STACK_CHECKER_ON
/*
* Initialize the stack bounds checker
+ * We can either turn it on here or from the app.
*/
-
-#ifdef STACK_CHECKER_ON
+
Stack_check_Initialize();
#endif
-
+
+#ifdef RTEMS_DEBUG
+ rtems_debug_enable( RTEMS_DEBUG_ALL_MASK );
+#endif
}
+
/*
* After drivers are setup, register some "filenames"
* and open stdin, stdout, stderr files
@@ -138,8 +163,8 @@ int main(
else
rtems_progname = "RTEMS";
- Cpu_table.pretasking_hook = NULL;
- Cpu_table.predriver_hook = bsp_libc_init; /* RTEMS resources available */
+ Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */
+ Cpu_table.predriver_hook = NULL;
Cpu_table.postdriver_hook = bsp_postdriver_hook;
Cpu_table.idle_task = NULL; /* do not override system IDLE task */
Cpu_table.do_zero_of_workspace = TRUE;