Print this page
5255 uts shouldn't open-code ISP2
@@ -21,10 +21,11 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+#include <sys/sysmacros.h>
#include <sys/machsystm.h>
#include <sys/cpu.h>
#include <sys/intreg.h>
#include <sys/machcpuvar.h>
#include <vm/hat_sfmmu.h>
@@ -96,11 +97,11 @@
/*
* contig_mem_alloc() requires size to be a power of 2.
* Increase size to a power of 2 if necessary.
*/
- if ((size & (size - 1)) != 0) {
+ if (!ISP2(size)) {
size = 1 << highbit(size);
}
mcpup->cpu_list = contig_mem_alloc(size);
@@ -206,11 +207,11 @@
/*
* contig_mem_alloc() requires size to be a power of 2.
* Increase size to a power of 2 if necessary.
*/
- if ((cpu_list_size & (cpu_list_size - 1)) != 0) {
+ if (!ISP2(cpu_list_size)) {
cpu_list_size = 1 << highbit(cpu_list_size);
}
if (mcpup->cpu_list) {
contig_mem_free(mcpup->cpu_list, cpu_list_size);