Use PAGE_MASK macro instead of (PAGE_SIZE - 1).

This commit is contained in:
tsutsui 2005-11-29 13:38:07 +00:00
parent c341912e62
commit d31aa5f6ce
1 changed files with 5 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cache.c,v 1.31 2005/11/10 15:31:17 tsutsui Exp $ */
/* $NetBSD: cache.c,v 1.32 2005/11/29 13:38:07 tsutsui Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.31 2005/11/10 15:31:17 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.32 2005/11/29 13:38:07 tsutsui Exp $");
#include "opt_cputype.h"
#include "opt_mips_cache.h"
@ -598,8 +598,7 @@ primary_cache_is_2way:
mips_pdcache_size = CACHE_R5900_SIZE_D;
mips_pdcache_line_size = CACHE_R5900_LSIZE_D;
mips_cache_alias_mask =
((mips_pdcache_size / mips_pdcache_ways) - 1) &
~(PAGE_SIZE - 1);
((mips_pdcache_size / mips_pdcache_ways) - 1) & ~PAGE_MASK;
mips_cache_prefer_mask =
max(mips_pdcache_size, mips_picache_size) - 1;
mips_cache_virtual_alias = 1;
@ -906,7 +905,7 @@ mips3_get_cache_config(int csizebase)
MIPS3_CONFIG_DB);
mips_cache_alias_mask =
((mips_pdcache_size / mips_pdcache_ways) - 1) & ~(PAGE_SIZE - 1);
((mips_pdcache_size / mips_pdcache_ways) - 1) & ~PAGE_MASK;
mips_cache_prefer_mask =
max(mips_pdcache_size, mips_picache_size) - 1;
@ -955,7 +954,7 @@ mips4_get_cache_config(int csizebase)
mips_pdcache_line_size = 32; /* 32 Byte */
mips_cache_alias_mask =
((mips_pdcache_size / mips_pdcache_ways) - 1) & ~(PAGE_SIZE - 1);
((mips_pdcache_size / mips_pdcache_ways) - 1) & ~PAGE_MASK;
mips_cache_prefer_mask =
max(mips_pdcache_size, mips_picache_size) - 1;
}