Deleted Added
full compact
vm_page.h (327701) vm_page.h (327785)
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. 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

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

52 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
53 * School of Computer Science
54 * Carnegie Mellon University
55 * Pittsburgh PA 15213-3890
56 *
57 * any improvements or extensions that they make and grant Carnegie the
58 * rights to redistribute these changes.
59 *
1/*-
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. 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

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

52 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
53 * School of Computer Science
54 * Carnegie Mellon University
55 * Pittsburgh PA 15213-3890
56 *
57 * any improvements or extensions that they make and grant Carnegie the
58 * rights to redistribute these changes.
59 *
60 * $FreeBSD: stable/11/sys/vm/vm_page.h 327701 2018-01-08 16:36:33Z markj $
60 * $FreeBSD: stable/11/sys/vm/vm_page.h 327785 2018-01-10 20:39:26Z markj $
61 */
62
63/*
64 * Resident memory system definitions.
65 */
66
67#ifndef _VM_PAGE_
68#define _VM_PAGE_

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

403 * (p) - vm_page_grab_pages() supports the flag.
404 * Bits above 15 define the count of additional pages that the caller
405 * intends to allocate.
406 */
407#define VM_ALLOC_NORMAL 0
408#define VM_ALLOC_INTERRUPT 1
409#define VM_ALLOC_SYSTEM 2
410#define VM_ALLOC_CLASS_MASK 3
61 */
62
63/*
64 * Resident memory system definitions.
65 */
66
67#ifndef _VM_PAGE_
68#define _VM_PAGE_

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

403 * (p) - vm_page_grab_pages() supports the flag.
404 * Bits above 15 define the count of additional pages that the caller
405 * intends to allocate.
406 */
407#define VM_ALLOC_NORMAL 0
408#define VM_ALLOC_INTERRUPT 1
409#define VM_ALLOC_SYSTEM 2
410#define VM_ALLOC_CLASS_MASK 3
411#define VM_ALLOC_WAITOK 0x0008 /* (acf) Sleep and retry */
412#define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */
411#define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */
412#define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */
413#define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */
414#define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */
415#define VM_ALLOC_IFCACHED 0x0400
416#define VM_ALLOC_IFNOTCACHED 0x0800
417#define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */
418#define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */
419#define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */
413#define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */
414#define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */
415#define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */
416#define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */
417#define VM_ALLOC_IFCACHED 0x0400
418#define VM_ALLOC_IFNOTCACHED 0x0800
419#define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */
420#define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */
421#define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */
420#define VM_ALLOC_NOWAIT 0x8000 /* (gp) Do not sleep */
422#define VM_ALLOC_NOWAIT 0x8000 /* (acfgp) Do not sleep */
421#define VM_ALLOC_COUNT_SHIFT 16
422#define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT)
423
424#ifdef M_NOWAIT
425static inline int
426malloc2vm_flags(int malloc_flags)
427{
428 int pflags;
429
430 KASSERT((malloc_flags & M_USE_RESERVE) == 0 ||
431 (malloc_flags & M_NOWAIT) != 0,
432 ("M_USE_RESERVE requires M_NOWAIT"));
433 pflags = (malloc_flags & M_USE_RESERVE) != 0 ? VM_ALLOC_INTERRUPT :
434 VM_ALLOC_SYSTEM;
435 if ((malloc_flags & M_ZERO) != 0)
436 pflags |= VM_ALLOC_ZERO;
437 if ((malloc_flags & M_NODUMP) != 0)
438 pflags |= VM_ALLOC_NODUMP;
423#define VM_ALLOC_COUNT_SHIFT 16
424#define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT)
425
426#ifdef M_NOWAIT
427static inline int
428malloc2vm_flags(int malloc_flags)
429{
430 int pflags;
431
432 KASSERT((malloc_flags & M_USE_RESERVE) == 0 ||
433 (malloc_flags & M_NOWAIT) != 0,
434 ("M_USE_RESERVE requires M_NOWAIT"));
435 pflags = (malloc_flags & M_USE_RESERVE) != 0 ? VM_ALLOC_INTERRUPT :
436 VM_ALLOC_SYSTEM;
437 if ((malloc_flags & M_ZERO) != 0)
438 pflags |= VM_ALLOC_ZERO;
439 if ((malloc_flags & M_NODUMP) != 0)
440 pflags |= VM_ALLOC_NODUMP;
441 if ((malloc_flags & M_NOWAIT))
442 pflags |= VM_ALLOC_NOWAIT;
443 if ((malloc_flags & M_WAITOK))
444 pflags |= VM_ALLOC_WAITOK;
439 return (pflags);
440}
441#endif
442
443/*
444 * Predicates supported by vm_page_ps_test():
445 *
446 * PS_ALL_DIRTY is true only if the entire (super)page is dirty.

--- 296 unchanged lines hidden ---
445 return (pflags);
446}
447#endif
448
449/*
450 * Predicates supported by vm_page_ps_test():
451 *
452 * PS_ALL_DIRTY is true only if the entire (super)page is dirty.

--- 296 unchanged lines hidden ---