Commit cd9da13d authored by Yoichi Yuasa's avatar Yoichi Yuasa Committed by Ralf Baechle

Fix divide by zero error in build_clear_page() and build_copy_page()

Signed-off-by: default avatarYoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 2cc3c0b6
...@@ -310,8 +310,8 @@ void __cpuinit build_clear_page(void) ...@@ -310,8 +310,8 @@ void __cpuinit build_clear_page(void)
if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
uasm_i_lui(&buf, AT, 0xa000); uasm_i_lui(&buf, AT, 0xa000);
off = min(8, pref_bias_clear_store / cache_line_size) * off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size)
cache_line_size; * cache_line_size : 0;
while (off) { while (off) {
build_clear_pref(&buf, -off); build_clear_pref(&buf, -off);
off -= cache_line_size; off -= cache_line_size;
...@@ -454,12 +454,14 @@ void __cpuinit build_copy_page(void) ...@@ -454,12 +454,14 @@ void __cpuinit build_copy_page(void)
if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())
uasm_i_lui(&buf, AT, 0xa000); uasm_i_lui(&buf, AT, 0xa000);
off = min(8, pref_bias_copy_load / cache_line_size) * cache_line_size; off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *
cache_line_size : 0;
while (off) { while (off) {
build_copy_load_pref(&buf, -off); build_copy_load_pref(&buf, -off);
off -= cache_line_size; off -= cache_line_size;
} }
off = min(8, pref_bias_copy_store / cache_line_size) * cache_line_size; off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) *
cache_line_size : 0;
while (off) { while (off) {
build_copy_store_pref(&buf, -off); build_copy_store_pref(&buf, -off);
off -= cache_line_size; off -= cache_line_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment