comparison arch/io.c @ 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 c75be274ce23
children f219716c6b54
comparison
equal deleted inserted replaced
15:c1212be83114 16:3d69c66b2610
40 psw.ba = 1; 40 psw.ba = 1;
41 psw.ptr = (u64) &IOINT; 41 psw.ptr = (u64) &IOINT;
42 42
43 __builtin_memcpy(((void*) 0x1f0), &psw, sizeof(struct psw)); 43 __builtin_memcpy(((void*) 0x1f0), &psw, sizeof(struct psw));
44 } 44 }
45
46 void wait_for_io_int()
47 {
48 struct psw psw;
49
50 __builtin_memset(&psw, 0, sizeof(struct psw));
51 psw.io = 1;
52 psw.ea = 1;
53 psw.ba = 1;
54 psw.w = 1;
55
56 asm volatile(
57 " larl %%r1,0f\n"
58 " stg %%r1,%0\n"
59 " lpswe %1\n"
60 "0:\n"
61 : /* output */
62 "=m" (psw.ptr)
63 : /* input */
64 "m" (psw)
65 : /* clobbered */
66 "r1", "r2"
67 );
68
69 if (*((u8*) 0x210) & 0x04)
70 return;
71
72 die();
73 }