aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2014-09-28 05:18:49 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2014-10-03 04:50:56 -0400
commit24cae7934cf1455c9793a95376a206ca6b965ade (patch)
tree0d67271e54c168ffb47cce2801b2d429a3b1f71d /arch/m68k
parente4dc601bf99ccd1c95b7e6eef1d3cf3c4b0d4961 (diff)
m68k: Reformat arch/m68k/mm/hwtest.c
No functional changes Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/mm/hwtest.c78
1 files changed, 40 insertions, 38 deletions
diff --git a/arch/m68k/mm/hwtest.c b/arch/m68k/mm/hwtest.c
index 2a5259fd23eb..fb8be4dd38c4 100644
--- a/arch/m68k/mm/hwtest.c
+++ b/arch/m68k/mm/hwtest.c
@@ -25,32 +25,32 @@
25 25
26#include <linux/module.h> 26#include <linux/module.h>
27 27
28int hwreg_present( volatile void *regp ) 28int hwreg_present(volatile void *regp)
29{ 29{
30 int ret = 0; 30 int ret = 0;
31 unsigned long flags; 31 unsigned long flags;
32 long save_sp, save_vbr; 32 long save_sp, save_vbr;
33 long tmp_vectors[3]; 33 long tmp_vectors[3];
34 34
35 local_irq_save(flags); 35 local_irq_save(flags);
36 __asm__ __volatile__ 36 __asm__ __volatile__ (
37 ( "movec %/vbr,%2\n\t" 37 "movec %/vbr,%2\n\t"
38 "movel #Lberr1,%4@(8)\n\t" 38 "movel #Lberr1,%4@(8)\n\t"
39 "movec %4,%/vbr\n\t" 39 "movec %4,%/vbr\n\t"
40 "movel %/sp,%1\n\t" 40 "movel %/sp,%1\n\t"
41 "moveq #0,%0\n\t" 41 "moveq #0,%0\n\t"
42 "tstb %3@\n\t" 42 "tstb %3@\n\t"
43 "nop\n\t" 43 "nop\n\t"
44 "moveq #1,%0\n" 44 "moveq #1,%0\n"
45 "Lberr1:\n\t" 45 "Lberr1:\n\t"
46 "movel %1,%/sp\n\t" 46 "movel %1,%/sp\n\t"
47 "movec %2,%/vbr" 47 "movec %2,%/vbr"
48 : "=&d" (ret), "=&r" (save_sp), "=&r" (save_vbr) 48 : "=&d" (ret), "=&r" (save_sp), "=&r" (save_vbr)
49 : "a" (regp), "a" (tmp_vectors) 49 : "a" (regp), "a" (tmp_vectors)
50 ); 50 );
51 local_irq_restore(flags); 51 local_irq_restore(flags);
52 52
53 return( ret ); 53 return ret;
54} 54}
55EXPORT_SYMBOL(hwreg_present); 55EXPORT_SYMBOL(hwreg_present);
56 56
@@ -58,34 +58,36 @@ EXPORT_SYMBOL(hwreg_present);
58 * by a bus error handler. Returns 1 if successful, 0 otherwise. 58 * by a bus error handler. Returns 1 if successful, 0 otherwise.
59 */ 59 */
60 60
61int hwreg_write( volatile void *regp, unsigned short val ) 61int hwreg_write(volatile void *regp, unsigned short val)
62{ 62{
63 int ret; 63 int ret;
64 unsigned long flags; 64 unsigned long flags;
65 long save_sp, save_vbr; 65 long save_sp, save_vbr;
66 long tmp_vectors[3]; 66 long tmp_vectors[3];
67 67
68 local_irq_save(flags); 68 local_irq_save(flags);
69 __asm__ __volatile__ 69 __asm__ __volatile__ (
70 ( "movec %/vbr,%2\n\t" 70 "movec %/vbr,%2\n\t"
71 "movel #Lberr2,%4@(8)\n\t" 71 "movel #Lberr2,%4@(8)\n\t"
72 "movec %4,%/vbr\n\t" 72 "movec %4,%/vbr\n\t"
73 "movel %/sp,%1\n\t" 73 "movel %/sp,%1\n\t"
74 "moveq #0,%0\n\t" 74 "moveq #0,%0\n\t"
75 "movew %5,%3@\n\t" 75 "movew %5,%3@\n\t"
76 "nop \n\t" /* If this nop isn't present, 'ret' may already be 76 "nop\n\t"
77 * loaded with 1 at the time the bus error 77 /*
78 * happens! */ 78 * If this nop isn't present, 'ret' may already be loaded
79 "moveq #1,%0\n" 79 * with 1 at the time the bus error happens!
80 */
81 "moveq #1,%0\n"
80 "Lberr2:\n\t" 82 "Lberr2:\n\t"
81 "movel %1,%/sp\n\t" 83 "movel %1,%/sp\n\t"
82 "movec %2,%/vbr" 84 "movec %2,%/vbr"
83 : "=&d" (ret), "=&r" (save_sp), "=&r" (save_vbr) 85 : "=&d" (ret), "=&r" (save_sp), "=&r" (save_vbr)
84 : "a" (regp), "a" (tmp_vectors), "g" (val) 86 : "a" (regp), "a" (tmp_vectors), "g" (val)
85 ); 87 );
86 local_irq_restore(flags); 88 local_irq_restore(flags);
87 89
88 return( ret ); 90 return ret;
89} 91}
90EXPORT_SYMBOL(hwreg_write); 92EXPORT_SYMBOL(hwreg_write);
91 93