Deleted Added
sdiff udiff text old ( 45347 ) new ( 46349 )
full compact
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.128 1999/03/19 05:21:03 alc 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 *

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

1455
1456 first_bit = base >> DEV_BSHIFT;
1457 last_bit = (base + size - 1) >> DEV_BSHIFT;
1458
1459 return ((2 << last_bit) - (1 << first_bit));
1460}
1461
1462/*
1463 * set a page valid and clean. May not block.
1464 *
1465 * In order to maintain consistancy due to the DEV_BSIZE granularity
1466 * of the valid bits, we have to zero non-DEV_BSIZE aligned portions of
1467 * the page at the beginning and end of the valid range when the
1468 * associated valid bits are not already set.
1469 *
1470 * (base + size) must be less then or equal to PAGE_SIZE.
1471 */
1472void
1473vm_page_set_validclean(m, base, size)
1474 vm_page_t m;
1475 int base;
1476 int size;
1477{
1478 int pagebits;

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

1524 pagebits = vm_page_bits(base, size);
1525 m->valid |= pagebits;
1526 m->dirty &= ~pagebits;
1527
1528 if (base == 0 && size == PAGE_SIZE)
1529 pmap_clear_modify(VM_PAGE_TO_PHYS(m));
1530}
1531
1532/*
1533 * set a page (partially) invalid. May not block.
1534 */
1535void
1536vm_page_set_invalid(m, base, size)
1537 vm_page_t m;
1538 int base;
1539 int size;
1540{
1541 int bits;
1542
1543 m->valid &= ~(bits = vm_page_bits(base, size));
1544 if (m->valid == 0)
1545 m->dirty &= ~bits;
1546 m->object->generation++;
1547}
1548
1549/*
1550 * vm_page_zero_invalid()
1551 *
1552 * The kernel assumes that the invalid portions of a page contain
1553 * garbage, but such pages can be mapped into memory by user code.

--- 335 unchanged lines hidden ---