summaryrefslogtreecommitdiffstats
path: root/bsps/i386/pc386/console/serial_mouse_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/i386/pc386/console/serial_mouse_config.c')
-rw-r--r--bsps/i386/pc386/console/serial_mouse_config.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/bsps/i386/pc386/console/serial_mouse_config.c b/bsps/i386/pc386/console/serial_mouse_config.c
new file mode 100644
index 0000000000..a8a0313954
--- /dev/null
+++ b/bsps/i386/pc386/console/serial_mouse_config.c
@@ -0,0 +1,48 @@
+/*
+ * COPYRIGHT (c) 1989-2011.
+ * On-Line Applications Research Corporation (OAR).
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <bsp.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <libchip/serial.h>
+#include "../../shared/dev/serial/legacy-console.h"
+
+/* select which serial port the mouse is connected to */
+#if defined(SERIAL_MOUSE_COM2)
+ #define MOUSE_DEVICE "/dev/com2"
+#else
+ #define MOUSE_DEVICE "/dev/com1"
+#endif
+
+static const char *SerialMouseDevice = MOUSE_DEVICE;
+
+bool bsp_get_serial_mouse_device(
+ const char **name,
+ const char **type
+)
+{
+ const char *consname;
+
+ *name = SerialMouseDevice;
+ *type = "ms";
+
+ /* Check if this port is not been used as console */
+ consname = Console_Port_Tbl[ Console_Port_Minor ]->sDeviceName;
+ if ( !strcmp(MOUSE_DEVICE, consname) ) {
+ printk( "SERIAL MOUSE: port selected as console.(%s)\n", *name );
+ rtems_fatal_error_occurred( -1 );
+ }
+
+ printk("Mouse Device: %s\n", *name );
+ return name;
+}