[rtems commit] bsps/powerpc: Fix shared console driver

Sebastian Huber sebh at rtems.org
Tue Jul 19 07:43:43 UTC 2016


Module:    rtems
Branch:    master
Commit:    c2a4b8bf37de516468cf73e039f0d4b1b4921d84
Changeset: http://git.rtems.org/rtems/commit/?id=c2a4b8bf37de516468cf73e039f0d4b1b4921d84

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Jul 19 09:42:26 2016 +0200

bsps/powerpc: Fix shared console driver

The Termios modes are now an emum.  Do not use them in #if expressions.

Close #2762.

---

 c/src/lib/libbsp/powerpc/shared/console/console.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/c/src/lib/libbsp/powerpc/shared/console/console.c b/c/src/lib/libbsp/powerpc/shared/console/console.c
index acaeb3d..082cbd9 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/console.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/console.c
@@ -22,7 +22,7 @@
 
 #include <stdlib.h>
 #include <assert.h>
-#include <stdlib.h>
+#include <inttypes.h>
 
 #include <bsp.h>
 #include <bsp/irq.h>
@@ -50,16 +50,12 @@ int BSPBaseBaud    = BSP_UART_BAUD_BASE;
  * we could even make it a link-time option (but that would require
  * small changes)...
  */
-#ifndef TERMIOS_OUTPUT_MODE
-  #if 1
-    #define TERMIOS_OUTPUT_MODE TERMIOS_IRQ_DRIVEN
-  #else
-    #define TERMIOS_OUTPUT_MODE TERMIOS_TASK_DRIVEN
-  #endif
-#endif
-
-#if ! defined(USE_POLLED_IO) && (TERMIOS_OUTPUT_MODE == TERMIOS_POLLED)
-  #define USE_POLLED_IO
+#if defined(USE_POLLED_IO)
+  #define TERMIOS_OUTPUT_MODE TERMIOS_POLLED
+#elif defined(USE_TASK_DRIVEN_IO)
+  #define TERMIOS_OUTPUT_MODE TERMIOS_TASK_DRIVEN
+#else
+  #define TERMIOS_OUTPUT_MODE TERMIOS_IRQ_DRIVEN
 #endif
 
 /*-------------------------------------------------------------------------+
@@ -133,7 +129,7 @@ rtems_device_driver console_initialize(
      */
     status = rtems_io_register_name ((nm=ttyS[minor].name), major, minor);
     if ( RTEMS_SUCCESSFUL==status && BSPConsolePort == minor) {
-      printk("Registering /dev/console as minor %d (==%s)\n",
+      printk("Registering /dev/console as minor %" PRIu32 " (==%s)\n",
               minor,
               ttyS[minor].name);
       /* also register an alias */
@@ -212,7 +208,7 @@ rtems_device_driver console_open(
   {
      console_first_open,                /* firstOpen */
      console_last_close,                /* lastClose */
-#if ( TERMIOS_OUTPUT_MODE == TERMIOS_TASK_DRIVEN )
+#ifdef USE_TASK_DRIVEN_IO
      BSP_uart_termios_read_com,         /* pollRead */
 #else
      NULL,                              /* pollRead */



More information about the vc mailing list