diff options
Diffstat (limited to 'drivers/s390/char/vmwatchdog.c')
-rw-r--r-- | drivers/s390/char/vmwatchdog.c | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/drivers/s390/char/vmwatchdog.c b/drivers/s390/char/vmwatchdog.c index 807320a41fa4..4b868f72fe89 100644 --- a/drivers/s390/char/vmwatchdog.c +++ b/drivers/s390/char/vmwatchdog.c | |||
@@ -54,48 +54,20 @@ enum vmwdt_func { | |||
54 | static int __diag288(enum vmwdt_func func, unsigned int timeout, | 54 | static int __diag288(enum vmwdt_func func, unsigned int timeout, |
55 | char *cmd, size_t len) | 55 | char *cmd, size_t len) |
56 | { | 56 | { |
57 | register unsigned long __func asm("2"); | 57 | register unsigned long __func asm("2") = func; |
58 | register unsigned long __timeout asm("3"); | 58 | register unsigned long __timeout asm("3") = timeout; |
59 | register unsigned long __cmdp asm("4"); | 59 | register unsigned long __cmdp asm("4") = virt_to_phys(cmd); |
60 | register unsigned long __cmdl asm("5"); | 60 | register unsigned long __cmdl asm("5") = len; |
61 | int err; | 61 | int err; |
62 | 62 | ||
63 | __func = func; | 63 | err = -EINVAL; |
64 | __timeout = timeout; | 64 | asm volatile( |
65 | __cmdp = virt_to_phys(cmd); | 65 | " diag %1,%3,0x288\n" |
66 | __cmdl = len; | 66 | "0: la %0,0\n" |
67 | err = 0; | 67 | "1:\n" |
68 | asm volatile ( | 68 | EX_TABLE(0b,1b) |
69 | #ifdef CONFIG_64BIT | 69 | : "=d" (err) : "d"(__func), "d"(__timeout), |
70 | "diag %2,%4,0x288\n" | 70 | "d"(__cmdp), "d"(__cmdl), "0" (-EINVAL) : "1", "cc"); |
71 | "1: \n" | ||
72 | ".section .fixup,\"ax\"\n" | ||
73 | "2: lghi %0,%1\n" | ||
74 | " jg 1b\n" | ||
75 | ".previous\n" | ||
76 | ".section __ex_table,\"a\"\n" | ||
77 | " .align 8\n" | ||
78 | " .quad 1b,2b\n" | ||
79 | ".previous\n" | ||
80 | #else | ||
81 | "diag %2,%4,0x288\n" | ||
82 | "1: \n" | ||
83 | ".section .fixup,\"ax\"\n" | ||
84 | "2: lhi %0,%1\n" | ||
85 | " bras 1,3f\n" | ||
86 | " .long 1b\n" | ||
87 | "3: l 1,0(1)\n" | ||
88 | " br 1\n" | ||
89 | ".previous\n" | ||
90 | ".section __ex_table,\"a\"\n" | ||
91 | " .align 4\n" | ||
92 | " .long 1b,2b\n" | ||
93 | ".previous\n" | ||
94 | #endif | ||
95 | : "+&d"(err) | ||
96 | : "i"(-EINVAL), "d"(__func), "d"(__timeout), | ||
97 | "d"(__cmdp), "d"(__cmdl) | ||
98 | : "1", "cc"); | ||
99 | return err; | 71 | return err; |
100 | } | 72 | } |
101 | 73 | ||