Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.h
Show First 20 Lines • Show All 535 Lines • ▼ Show 20 Lines | |||||
#define VM_ALLOC_NORMAL 0 | #define VM_ALLOC_NORMAL 0 | ||||
#define VM_ALLOC_INTERRUPT 1 | #define VM_ALLOC_INTERRUPT 1 | ||||
#define VM_ALLOC_SYSTEM 2 | #define VM_ALLOC_SYSTEM 2 | ||||
#define VM_ALLOC_CLASS_MASK 3 | #define VM_ALLOC_CLASS_MASK 3 | ||||
#define VM_ALLOC_WAITOK 0x0008 /* (acf) Sleep and retry */ | #define VM_ALLOC_WAITOK 0x0008 /* (acf) Sleep and retry */ | ||||
#define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */ | #define VM_ALLOC_WAITFAIL 0x0010 /* (acf) Sleep and return error */ | ||||
#define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */ | #define VM_ALLOC_WIRED 0x0020 /* (acfgp) Allocate a wired page */ | ||||
#define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ | #define VM_ALLOC_ZERO 0x0040 /* (acfgp) Allocate a prezeroed page */ | ||||
#define VM_ALLOC_NORECLAIM 0x0080 /* (c) Do not reclaim after failure */ | |||||
#define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ | #define VM_ALLOC_NOOBJ 0x0100 /* (acg) No associated object */ | ||||
#define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ | #define VM_ALLOC_NOBUSY 0x0200 /* (acgp) Do not excl busy the page */ | ||||
#define VM_ALLOC_NOCREAT 0x0400 /* (gp) Don't create a page */ | #define VM_ALLOC_NOCREAT 0x0400 /* (gp) Don't create a page */ | ||||
#define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ | #define VM_ALLOC_IGN_SBUSY 0x1000 /* (gp) Ignore shared busy flag */ | ||||
#define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ | #define VM_ALLOC_NODUMP 0x2000 /* (ag) don't include in dump */ | ||||
#define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ | #define VM_ALLOC_SBUSY 0x4000 /* (acgp) Shared busy the page */ | ||||
#define VM_ALLOC_NOWAIT 0x8000 /* (acfgp) Do not sleep */ | #define VM_ALLOC_NOWAIT 0x8000 /* (acfgp) Do not sleep */ | ||||
#define VM_ALLOC_COUNT_SHIFT 16 | #define VM_ALLOC_COUNT_SHIFT 16 | ||||
kib: Doesn't the value conflict with VM_ALLOC_COUNT() ? | |||||
Done Inline ActionsOh jeez, I didn't even notice. Should I take 0x04 as bit 2 is supposed to be free or do we need to do something else here? rstone: Oh jeez, I didn't even notice. Should I take 0x04 as bit 2 is supposed to be free or do we… | |||||
Done Inline ActionsI would take 0x80 or 0x800. kib: I would take 0x80 or 0x800. | |||||
#define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) | #define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) | ||||
#ifdef M_NOWAIT | #ifdef M_NOWAIT | ||||
static inline int | static inline int | ||||
malloc2vm_flags(int malloc_flags) | malloc2vm_flags(int malloc_flags) | ||||
{ | { | ||||
int pflags; | int pflags; | ||||
KASSERT((malloc_flags & M_USE_RESERVE) == 0 || | KASSERT((malloc_flags & M_USE_RESERVE) == 0 || | ||||
(malloc_flags & M_NOWAIT) != 0, | (malloc_flags & M_NOWAIT) != 0, | ||||
("M_USE_RESERVE requires M_NOWAIT")); | ("M_USE_RESERVE requires M_NOWAIT")); | ||||
pflags = (malloc_flags & M_USE_RESERVE) != 0 ? VM_ALLOC_INTERRUPT : | pflags = (malloc_flags & M_USE_RESERVE) != 0 ? VM_ALLOC_INTERRUPT : | ||||
VM_ALLOC_SYSTEM; | VM_ALLOC_SYSTEM; | ||||
if ((malloc_flags & M_ZERO) != 0) | if ((malloc_flags & M_ZERO) != 0) | ||||
pflags |= VM_ALLOC_ZERO; | pflags |= VM_ALLOC_ZERO; | ||||
if ((malloc_flags & M_NODUMP) != 0) | if ((malloc_flags & M_NODUMP) != 0) | ||||
pflags |= VM_ALLOC_NODUMP; | pflags |= VM_ALLOC_NODUMP; | ||||
if ((malloc_flags & M_NOWAIT)) | if ((malloc_flags & M_NOWAIT)) | ||||
pflags |= VM_ALLOC_NOWAIT; | pflags |= VM_ALLOC_NOWAIT; | ||||
if ((malloc_flags & M_WAITOK)) | if ((malloc_flags & M_WAITOK)) | ||||
pflags |= VM_ALLOC_WAITOK; | pflags |= VM_ALLOC_WAITOK; | ||||
if ((malloc_flags & M_NORECLAIM)) | |||||
pflags |= VM_ALLOC_NORECLAIM; | |||||
return (pflags); | return (pflags); | ||||
} | } | ||||
#endif | #endif | ||||
/* | /* | ||||
* Predicates supported by vm_page_ps_test(): | * Predicates supported by vm_page_ps_test(): | ||||
* | * | ||||
* PS_ALL_DIRTY is true only if the entire (super)page is dirty. | * PS_ALL_DIRTY is true only if the entire (super)page is dirty. | ||||
▲ Show 20 Lines • Show All 436 Lines • Show Last 20 Lines |
Doesn't the value conflict with VM_ALLOC_COUNT() ?