patch-2.1.126 linux/arch/alpha/lib/srm_puts.c

Next file: linux/arch/alpha/mm/init.c
Previous file: linux/arch/alpha/lib/srm_printk.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.125/linux/arch/alpha/lib/srm_puts.c linux/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;
+		}
+	}
+}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov