vm_page.c (bef608bd7ee7f08b6e3ff2aad04c62e5d756fd3a) vm_page.c (c1087c13240442926a34afa825b4dd3993868549)
1/*
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
1/*
2 * Copyright (c) 1991 Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * The Mach Operating System project at Carnegie-Mellon University.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
37 * $Id: vm_page.c,v 1.96 1998/03/08 06:27:30 dyson Exp $
37 * $Id: vm_page.c,v 1.97 1998/03/16 01:55:55 dyson Exp $
38 */
39
40/*
41 * Copyright (c) 1987, 1990 Carnegie-Mellon University.
42 * All rights reserved.
43 *
44 * Authors: Avadis Tevanian, Jr., Michael Wayne Young
45 *

--- 110 unchanged lines hidden (view full) ---

156 * map of contiguous valid DEV_BSIZE chunks in a page
157 * (this list is valid for page sizes upto 16*DEV_BSIZE)
158 */
159static u_short vm_page_dev_bsize_chunks[] = {
160 0x0, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff,
161 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff
162};
163
38 */
39
40/*
41 * Copyright (c) 1987, 1990 Carnegie-Mellon University.
42 * All rights reserved.
43 *
44 * Authors: Avadis Tevanian, Jr., Michael Wayne Young
45 *

--- 110 unchanged lines hidden (view full) ---

156 * map of contiguous valid DEV_BSIZE chunks in a page
157 * (this list is valid for page sizes upto 16*DEV_BSIZE)
158 */
159static u_short vm_page_dev_bsize_chunks[] = {
160 0x0, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff,
161 0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff
162};
163
164static inline int vm_page_hash __P((vm_object_t object, vm_pindex_t pindex));
164static __inline int vm_page_hash __P((vm_object_t object, vm_pindex_t pindex));
165static int vm_page_freechk_and_unqueue __P((vm_page_t m));
166static void vm_page_free_wakeup __P((void));
167
168/*
169 * vm_set_page_size:
170 *
171 * Sets the page size, perhaps based upon the memory
172 * size. Must be called before any use of page-size

--- 186 unchanged lines hidden (view full) ---

359
360/*
361 * vm_page_hash:
362 *
363 * Distributes the object/offset key pair among hash buckets.
364 *
365 * NOTE: This macro depends on vm_page_bucket_count being a power of 2.
366 */
165static int vm_page_freechk_and_unqueue __P((vm_page_t m));
166static void vm_page_free_wakeup __P((void));
167
168/*
169 * vm_set_page_size:
170 *
171 * Sets the page size, perhaps based upon the memory
172 * size. Must be called before any use of page-size

--- 186 unchanged lines hidden (view full) ---

359
360/*
361 * vm_page_hash:
362 *
363 * Distributes the object/offset key pair among hash buckets.
364 *
365 * NOTE: This macro depends on vm_page_bucket_count being a power of 2.
366 */
367static inline int
367static __inline int
368vm_page_hash(object, pindex)
369 vm_object_t object;
370 vm_pindex_t pindex;
371{
372 return ((((unsigned) object) >> 5) + (pindex >> 1)) & vm_page_hash_mask;
373}
374
375/*

--- 1039 unchanged lines hidden (view full) ---

1415
1416 return m;
1417}
1418
1419/*
1420 * mapping function for valid bits or for dirty bits in
1421 * a page
1422 */
368vm_page_hash(object, pindex)
369 vm_object_t object;
370 vm_pindex_t pindex;
371{
372 return ((((unsigned) object) >> 5) + (pindex >> 1)) & vm_page_hash_mask;
373}
374
375/*

--- 1039 unchanged lines hidden (view full) ---

1415
1416 return m;
1417}
1418
1419/*
1420 * mapping function for valid bits or for dirty bits in
1421 * a page
1422 */
1423inline int
1423__inline int
1424vm_page_bits(int base, int size)
1425{
1426 u_short chunk;
1427
1428 if ((base == 0) && (size >= PAGE_SIZE))
1429 return VM_PAGE_BITS_ALL;
1430
1431 size = (size + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);

--- 327 unchanged lines hidden ---
1424vm_page_bits(int base, int size)
1425{
1426 u_short chunk;
1427
1428 if ((base == 0) && (size >= PAGE_SIZE))
1429 return VM_PAGE_BITS_ALL;
1430
1431 size = (size + DEV_BSIZE - 1) & ~(DEV_BSIZE - 1);

--- 327 unchanged lines hidden ---