<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-02-28)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-02-28 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * console.c: Register also normal device file of the console device.
        Call initialization before the device file registration.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/shared/ChangeLog.diff?r1=text&tr1=1.183&r2=text&tr2=1.184&diff_format=h">M</a></td><td width='1%'>1.184</td><td width='100%'>c/src/lib/libbsp/shared/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/shared/console.c.diff?r1=text&tr1=1.14&r2=text&tr2=1.15&diff_format=h">M</a></td><td width='1%'>1.15</td><td width='100%'>c/src/lib/libbsp/shared/console.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/shared/ChangeLog:1.183 rtems/c/src/lib/libbsp/shared/ChangeLog:1.184
--- rtems/c/src/lib/libbsp/shared/ChangeLog:1.183       Wed Feb  9 00:36:52 2011
+++ rtems/c/src/lib/libbsp/shared/ChangeLog     Mon Feb 28 09:11:48 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-02-28    Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * console.c: Register also normal device file of the console device.
+       Call initialization before the device file registration.
+
</font> 2011-02-09        Ralf Corsépius <ralf.corsepius@rtems.org>
 
        * timerstub.c: Include <rtems/btimer.h>.

<font color='#006600'>diff -u rtems/c/src/lib/libbsp/shared/console.c:1.14 rtems/c/src/lib/libbsp/shared/console.c:1.15
--- rtems/c/src/lib/libbsp/shared/console.c:1.14        Tue Feb  1 09:48:26 2011
+++ rtems/c/src/lib/libbsp/shared/console.c     Mon Feb 28 09:11:48 2011
</font><font color='#997700'>@@ -16,6 +16,7 @@
</font> 
 #include <bsp.h>
 #include <rtems/libio.h>
<font color='#000088'>+#include <rtems/console.h>
</font> #include <stdlib.h>
 #include <assert.h>
 #include <termios.h>
<font color='#997700'>@@ -216,77 +217,44 @@
</font> 
 rtems_device_driver console_initialize(
   rtems_device_major_number  major,
<font color='#880000'>-  rtems_device_minor_number  minor_arg,
</font><font color='#000088'>+  rtems_device_minor_number  minor,
</font>   void                      *arg
 )
 {
<font color='#880000'>-  rtems_status_code          status;
-  rtems_device_minor_number  minor;
-
-  /*
-   * initialize the termio interface.
-   */
</font><font color='#000088'>+  rtems_status_code sc = RTEMS_SUCCESSFUL;
+  bool first = true;
</font> 
   rtems_termios_initialize();
 
<font color='#880000'>-  for (minor=0; minor < Console_Port_Count ; minor++) {
-    /*
-     * First perform the configuration dependent probe, then the
-     * device dependent probe
-     */
</font><font color='#000088'>+  for (minor = 0; minor < Console_Port_Count; ++minor) {
+    const console_tbl *device = &Console_Port_Tbl [minor];
</font> 
<font color='#880000'>-    if ((!Console_Port_Tbl[minor].deviceProbe ||
-         Console_Port_Tbl[minor].deviceProbe(minor)) &&
-         Console_Port_Tbl[minor].pDeviceFns->deviceProbe(minor)) {
-      /*
-       * Use this device for the console
-       */
-      break;
</font><font color='#000088'>+    if (
+      (device->deviceProbe == NULL || device->deviceProbe(minor))
+        && device->pDeviceFns->deviceProbe(minor)
+    ) {
+      device->pDeviceFns->deviceInitialize(minor);
+      if (first) {
+        first = false;
+        Console_Port_Minor = minor;
+        sc = rtems_io_register_name(CONSOLE_DEVICE_NAME, major, minor);
+        if (sc != RTEMS_SUCCESSFUL) {
+          rtems_fatal_error_occurred(sc);
+        }
+      }
+      sc = rtems_io_register_name(device->sDeviceName, major, minor);
+      if (sc != RTEMS_SUCCESSFUL) {
+        rtems_fatal_error_occurred(sc);
+      }
</font>     }
   }
<font color='#880000'>-  if ( minor == Console_Port_Count ) {
</font><font color='#000088'>+
+  if (first) {
</font>     /*
      * Failed to find a working device
      */
     rtems_fatal_error_occurred(RTEMS_IO_ERROR);
   }
 
<font color='#880000'>-  Console_Port_Minor=minor;
-
-  /*
-   * Register Device Names
-   */
-  status = rtems_io_register_name("/dev/console", major, Console_Port_Minor );
-  if (status != RTEMS_SUCCESSFUL) {
-    rtems_fatal_error_occurred(status);
-  }
-  Console_Port_Tbl[minor].pDeviceFns->deviceInitialize(Console_Port_Minor);
-
-  for (minor++;minor<Console_Port_Count;minor++) {
-    /*
-     * First perform the configuration dependent probe, then the
-     * device dependent probe
-     */
-
-    if ( (!Console_Port_Tbl[minor].deviceProbe ||
-         Console_Port_Tbl[minor].deviceProbe(minor)) &&
-         Console_Port_Tbl[minor].pDeviceFns->deviceProbe(minor)) {
-      status = rtems_io_register_name(
-        Console_Port_Tbl[minor].sDeviceName,
-        major,
-        minor );
-      if (status != RTEMS_SUCCESSFUL) {
-        rtems_fatal_error_occurred(status);
-      }
-
-      /*
-       * Initialize the hardware device.
-       */
-
-      Console_Port_Tbl[minor].pDeviceFns->deviceInitialize(minor);
-
-    }
-  }
-
</font>   return RTEMS_SUCCESSFUL;
 }
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>