summaryrefslogtreecommitdiffstats
path: root/arch/alpha/lib/srm_puts.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-03 17:49:53 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-03 17:49:53 +0000
commiteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (patch)
tree5746fea1605ff013be9b78a1556aaad7615d664a /arch/alpha/lib/srm_puts.c
parent80ea5b1e15398277650e1197957053b5a71c08bc (diff)
Merge with Linux 2.1.131 plus some more MIPS goodies.
Diffstat (limited to 'arch/alpha/lib/srm_puts.c')
-rw-r--r--arch/alpha/lib/srm_puts.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/alpha/lib/srm_puts.c b/arch/alpha/lib/srm_puts.c
new file mode 100644
index 000000000..87b1d1155
--- /dev/null
+++ b/arch/alpha/lib/srm_puts.c
@@ -0,0 +1,34 @@
+/*
+ * arch/alpha/lib/srm_puts.c
+ */
+
+#include <linux/string.h>
+#include <asm/console.h>
+
+void
+srm_puts(const char *str)
+{
+ /* Expand \n to \r\n as we go. */
+
+ while (*str) {
+ long len;
+ const char *e = str;
+
+ if (*str == '\n') {
+ if (srm_dispatch(CCB_PUTS, 0, "\r", 1) < 0)
+ return;
+ ++e;
+ }
+
+ e = strchr(e, '\n') ? : strchr(e, '\0');
+ len = e - str;
+
+ while (len > 0) {
+ long written = srm_dispatch(CCB_PUTS, 0, str, len);
+ if (written < 0)
+ return;
+ len -= written & 0xffffffff;
+ str += written & 0xffffffff;
+ }
+ }
+}