summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2003-07-22 07:33:14 +0000
committerEric Andersen2003-07-22 07:33:14 +0000
commit592ebd507a444a69e6d0f2183060fbb1c795eac4 (patch)
tree1e29c0b2ff13c8ab0b5c27c3428353a7d5bdee59
parent3443bd72863326cca2ef4ba78965c05abc77cb96 (diff)
downloadbusybox-592ebd507a444a69e6d0f2183060fbb1c795eac4.zip
busybox-592ebd507a444a69e6d0f2183060fbb1c795eac4.tar.gz
Patch from Paul Mundt:
The current SC_x references automatically assume that everyone uses ttyS/tts as their naming scheme for their serial ports. This isn't the case for quite a few architectures, including sh, sh64, h8, arm, etc.
-rw-r--r--include/libbb.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/include/libbb.h b/include/libbb.h
index e43c4f5..6bd096c 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -359,10 +359,19 @@ extern int bb_default_error_retval;
# define VC_3 "/dev/vc/3"
# define VC_4 "/dev/vc/4"
# define VC_5 "/dev/vc/5"
-# define SC_0 "/dev/tts/0"
-# define SC_1 "/dev/tts/1"
+#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__)
+/* Yes, this sucks, but both SH (including sh64) and H8 have a SCI(F) for their
+ respective serial ports .. as such, we can't use the common device paths for
+ these. -- PFM */
+# define SC_0 "/dev/ttsc/0"
+# define SC_1 "/dev/ttsc/1"
+# define SC_FORMAT "/dev/ttsc/%d"
+#else
+# define SC_0 "/dev/tts/0"
+# define SC_1 "/dev/tts/1"
+# define SC_FORMAT "/dev/tts/%d"
+#endif
# define VC_FORMAT "/dev/vc/%d"
-# define SC_FORMAT "/dev/tts/%d"
# define LOOP_FORMAT "/dev/loop/%d"
#else
# define CURRENT_VC "/dev/tty0"
@@ -371,10 +380,16 @@ extern int bb_default_error_retval;
# define VC_3 "/dev/tty3"
# define VC_4 "/dev/tty4"
# define VC_5 "/dev/tty5"
-# define SC_0 "/dev/ttyS0"
-# define SC_1 "/dev/ttyS1"
+#if defined(__sh__) || defined(__H8300H__) || defined(__H8300S__)
+# define SC_0 "/dev/ttySC0"
+# define SC_1 "/dev/ttySC1"
+# define SC_FORMAT "/dev/ttySC%d"
+#else
+# define SC_0 "/dev/ttyS0"
+# define SC_1 "/dev/ttyS1"
+# define SC_FORMAT "/dev/ttyS%d"
+#endif
# define VC_FORMAT "/dev/tty%d"
-# define SC_FORMAT "/dev/ttyS%d"
# define LOOP_FORMAT "/dev/loop%d"
#endif