* hppa-dis.c (print_insn_hppa): Change condition args to use
[deliverable/binutils-gdb.git] / gdb / rdi-share / unixcomm.c
index 7cb55e6c8d5e897d2a508618e5c029ffea27a1c3..61d84e33be18ae9c84c1d742f4acdaf232314e9a 100644 (file)
 #endif
 
 #ifdef __linux__
-#define SERPORT1   "/dev/cua0"
-#define SERPORT2   "/dev/cua1"
+#define SERPORT1   "/dev/ttyS0"
+#define SERPORT2   "/dev/ttyS1"
 #define PARPORT1   "/dev/par0"
 #define PARPORT2   "/dev/par1"
 #endif
 
-#ifdef _WIN32
+#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (bsdi)
+#define SERPORT1   "/dev/cuaa0"
+#define SERPORT2   "/dev/cuaa1"
+#define PARPORT1   "/dev/lpt0"
+#define PARPORT2   "/dev/lpt1"
+#endif
+
+
+#define SERIAL_PREFIX "/dev/tty"
+#if defined(_WIN32) || defined (__CYGWIN32__) 
 #define SERPORT1   "com1"
 #define SERPORT2   "com2"
 #define PARPORT1   "lpt1"
 #define PARPORT2   "lpt2"
+#undef SERIAL_PREFIX
+#define SERIAL_PREFIX "com"
 #endif
 
+
+
 /*
  * Parallel port output pins, used for signalling to target
  */
@@ -121,7 +134,11 @@ extern const char *Unix_MatchValidSerialDevice(const char *name)
    */
 
   /* Accept /dev/tty* where * is limited */
-  if (strlen(name) == strlen(SERPORT1) && strncmp(name, "/dev/tty", 8) == 0) return name;
+  if (strlen(name) == strlen(SERPORT1)
+      && strncmp(name, SERIAL_PREFIX, strlen (SERIAL_PREFIX)) == 0)
+      {
+        return name;
+      }
 
   /* Accept "1" or "2" or "S" - S is equivalent to "1" */
   if (strcmp(name, "1") == 0 ||
@@ -224,7 +241,7 @@ extern int Unix_IsSerialInUse(void)
 
 extern int Unix_OpenSerial(const char *name)
 {
-#if defined(BSD)
+#if defined(BSD) || defined(__CYGWIN32__)
     serpfd = open(name, O_RDWR);
 #else
     serpfd = open(name, O_RDWR | O_NONBLOCK);
@@ -288,15 +305,6 @@ extern void Unix_ResetSerial(void)
     struct termios terminfo;
 
     tcgetattr(serpfd, &terminfo);
-#ifdef __CYGWIN32__
-    /* Expedient, but it works.  */
-    terminfo.c_iflag = 0;
-    terminfo.c_oflag = 0;
-    terminfo.c_cflag = 48;
-    terminfo.c_lflag = 0;
-    terminfo.c_cc[VMIN] = 0;
-    terminfo.c_cc[VTIME] = 1;
-#else
     terminfo.c_lflag &= ~(ICANON | ISIG | ECHO | IEXTEN);
     terminfo.c_iflag &= ~(IGNCR | INPCK | ISTRIP | ICRNL | BRKINT);
     terminfo.c_iflag |= (IXON | IXOFF | IGNBRK);
@@ -305,7 +313,6 @@ extern void Unix_ResetSerial(void)
     terminfo.c_cc[VMIN] = 1;
     terminfo.c_cc[VTIME] = 0;
     terminfo.c_oflag &= ~OPOST;
-#endif
     tcsetattr(serpfd, TCSAFLUSH, &terminfo);
 }
 
This page took 0.025981 seconds and 4 git commands to generate.