aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/entry.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/entry.S')
-rw-r--r--arch/sparc/kernel/entry.S27
1 files changed, 16 insertions, 11 deletions
diff --git a/arch/sparc/kernel/entry.S b/arch/sparc/kernel/entry.S
index 773f3f05bf26..3f3976e0e98f 100644
--- a/arch/sparc/kernel/entry.S
+++ b/arch/sparc/kernel/entry.S
@@ -1161,11 +1161,13 @@ fpload:
1161 .globl __ndelay 1161 .globl __ndelay
1162__ndelay: 1162__ndelay:
1163 save %sp, -STACKFRAME_SZ, %sp 1163 save %sp, -STACKFRAME_SZ, %sp
1164 mov %i0, %o0 1164 mov %i0, %o0 ! round multiplier up so large ns ok
1165 call .umul ! round multiplier up so large ns ok 1165 mov 0x1ae, %o1 ! 2**32 / (1 000 000 000 / HZ)
1166 mov 0x1ae, %o1 ! 2**32 / (1 000 000 000 / HZ) 1166 umul %o0, %o1, %o0
1167 call .umul 1167 rd %y, %o1
1168 mov %i1, %o1 ! udelay_val 1168 mov %i1, %o1 ! udelay_val
1169 umul %o0, %o1, %o0
1170 rd %y, %o1
1169 ba delay_continue 1171 ba delay_continue
1170 mov %o1, %o0 ! >>32 later for better resolution 1172 mov %o1, %o0 ! >>32 later for better resolution
1171 1173
@@ -1174,18 +1176,21 @@ __udelay:
1174 save %sp, -STACKFRAME_SZ, %sp 1176 save %sp, -STACKFRAME_SZ, %sp
1175 mov %i0, %o0 1177 mov %i0, %o0
1176 sethi %hi(0x10c7), %o1 ! round multiplier up so large us ok 1178 sethi %hi(0x10c7), %o1 ! round multiplier up so large us ok
1177 call .umul 1179 or %o1, %lo(0x10c7), %o1 ! 2**32 / 1 000 000
1178 or %o1, %lo(0x10c7), %o1 ! 2**32 / 1 000 000 1180 umul %o0, %o1, %o0
1179 call .umul 1181 rd %y, %o1
1180 mov %i1, %o1 ! udelay_val 1182 mov %i1, %o1 ! udelay_val
1183 umul %o0, %o1, %o0
1184 rd %y, %o1
1181 sethi %hi(0x028f4b62), %l0 ! Add in rounding constant * 2**32, 1185 sethi %hi(0x028f4b62), %l0 ! Add in rounding constant * 2**32,
1182 or %g0, %lo(0x028f4b62), %l0 1186 or %g0, %lo(0x028f4b62), %l0
1183 addcc %o0, %l0, %o0 ! 2**32 * 0.009 999 1187 addcc %o0, %l0, %o0 ! 2**32 * 0.009 999
1184 bcs,a 3f 1188 bcs,a 3f
1185 add %o1, 0x01, %o1 1189 add %o1, 0x01, %o1
11863: 11903:
1187 call .umul 1191 mov HZ, %o0 ! >>32 earlier for wider range
1188 mov HZ, %o0 ! >>32 earlier for wider range 1192 umul %o0, %o1, %o0
1193 rd %y, %o1
1189 1194
1190delay_continue: 1195delay_continue:
1191 cmp %o0, 0x0 1196 cmp %o0, 0x0