changeset 16:3d69c66b2610

arch: last fixup, now things seem to work as expected
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Fri, 08 Apr 2011 09:44:57 -0400
parents c1212be83114
children 0d5e25251e10
files arch/channel.h arch/io.c
diffstat 2 files changed, 30 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/arch/channel.h	Thu Apr 07 23:30:04 2011 -0400
+++ b/arch/channel.h	Fri Apr 08 09:44:57 2011 -0400
@@ -219,28 +219,6 @@
 	return cc;
 }
 
-static inline void wait_for_io_int()
-{
-	struct psw psw;
-
-        __builtin_memset(&psw, 0, sizeof(struct psw));
-        psw.io  = 1;
-        psw.ea  = 1;
-        psw.ba  = 1;
-	psw.w   = 1;
-
-        asm volatile(
-                "       larl    %%r1,0f\n"
-                "       stg     %%r1,%0\n"
-                "       lpswe   %1\n"
-                "0:\n"
-        : /* output */
-          "=m" (psw.ptr)
-        : /* input */
-          "m" (psw)
-        : /* clobbered */
-          "r1", "r2"
-        );
-}
+extern void wait_for_io_int();
 
 #endif
--- a/arch/io.c	Thu Apr 07 23:30:04 2011 -0400
+++ b/arch/io.c	Fri Apr 08 09:44:57 2011 -0400
@@ -42,3 +42,32 @@
 
 	__builtin_memcpy(((void*) 0x1f0), &psw, sizeof(struct psw));
 }
+
+void wait_for_io_int()
+{
+	struct psw psw;
+
+        __builtin_memset(&psw, 0, sizeof(struct psw));
+        psw.io  = 1;
+        psw.ea  = 1;
+        psw.ba  = 1;
+	psw.w   = 1;
+
+        asm volatile(
+                "       larl    %%r1,0f\n"
+                "       stg     %%r1,%0\n"
+                "       lpswe   %1\n"
+                "0:\n"
+        : /* output */
+          "=m" (psw.ptr)
+        : /* input */
+          "m" (psw)
+        : /* clobbered */
+          "r1", "r2"
+        );
+
+	if (*((u8*) 0x210) & 0x04)
+		return;
+
+	die();
+}