summaryrefslogtreecommitdiff
path: root/usr/src/uts/i86pc
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/i86pc')
-rw-r--r--usr/src/uts/i86pc/os/startup.c6
-rw-r--r--usr/src/uts/i86pc/sys/machparam.h3
-rw-r--r--usr/src/uts/i86pc/vm/vm_machdep.c4
3 files changed, 10 insertions, 3 deletions
diff --git a/usr/src/uts/i86pc/os/startup.c b/usr/src/uts/i86pc/os/startup.c
index ad719dfcdd..f69b37a9f2 100644
--- a/usr/src/uts/i86pc/os/startup.c
+++ b/usr/src/uts/i86pc/os/startup.c
@@ -289,6 +289,7 @@ int segzio_fromheap = 1;
* VM data structures
*/
long page_hashsz; /* Size of page hash table (power of two) */
+unsigned int page_hashsz_shift; /* log2(page_hashsz) */
struct page *pp_base; /* Base of initial system page struct array */
struct page **page_hash; /* Page hash table */
pad_mutex_t *pse_mutex; /* Locks protecting pp->p_selock */
@@ -1126,12 +1127,15 @@ startup_memlist(void)
ADD_TO_ALLOCATIONS(bios_rsvd, rsvdmemlist_sz);
PRM_DEBUG(rsvdmemlist_sz);
+ /* LINTED */
+ ASSERT(P2SAMEHIGHBIT((1 << PP_SHIFT), sizeof (struct page)));
/*
* The page structure hash table size is a power of 2
* such that the average hash chain length is PAGE_HASHAVELEN.
*/
page_hashsz = npages / PAGE_HASHAVELEN;
- page_hashsz = 1 << highbit(page_hashsz);
+ page_hashsz_shift = highbit(page_hashsz);
+ page_hashsz = 1 << page_hashsz_shift;
pagehash_sz = sizeof (struct page *) * page_hashsz;
ADD_TO_ALLOCATIONS(page_hash, pagehash_sz);
PRM_DEBUG(pagehash_sz);
diff --git a/usr/src/uts/i86pc/sys/machparam.h b/usr/src/uts/i86pc/sys/machparam.h
index ed3c5d5fcc..a0fa08db16 100644
--- a/usr/src/uts/i86pc/sys/machparam.h
+++ b/usr/src/uts/i86pc/sys/machparam.h
@@ -60,6 +60,9 @@ extern "C" {
#define NCPU_LOG2 5
#endif
+/* NCPU_P2 is NCPU rounded to a power of 2 */
+#define NCPU_P2 (1 << NCPU_LOG2)
+
/*
* The value defined below could grow to 16. hat structure and
* page_t have room for 16 nodes.
diff --git a/usr/src/uts/i86pc/vm/vm_machdep.c b/usr/src/uts/i86pc/vm/vm_machdep.c
index 79c0ee073e..dfdca87e1c 100644
--- a/usr/src/uts/i86pc/vm/vm_machdep.c
+++ b/usr/src/uts/i86pc/vm/vm_machdep.c
@@ -19,8 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
+ * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
*/
/*
* Copyright (c) 2010, Intel Corporation.
@@ -58,6 +57,7 @@
#include <sys/exechdr.h>
#include <sys/debug.h>
#include <sys/vmsystm.h>
+#include <sys/swap.h>
#include <vm/hat.h>
#include <vm/as.h>