Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_page.h
Show First 20 Lines • Show All 544 Lines • ▼ Show 20 Lines | |||||
#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 /* (acgnp) Do not sleep */ | #define VM_ALLOC_NOWAIT 0x8000 /* (acgnp) Do not sleep */ | ||||
#define VM_ALLOC_COUNT_SHIFT 16 | #define VM_ALLOC_COUNT_SHIFT 16 | ||||
#define VM_ALLOC_COUNT_MASK 0xffff0000 | |||||
kib: Could this be VM_ALLOC_COUNT(VM_ALLOC_COUNT_MAX - 1) and count < VM_ALLOC_COUNT_MAX could be… | |||||
Done Inline ActionsAre you suggesting using a statement expression there, e.g., #define VM_ALLOC_COUNT(count) ({ MPASS(count < VM_ALLOC_COUNT_MAX); count << VM_ALLOC_COUNT_SHIFT; }) ? markj: Are you suggesting using a statement expression there, e.g.,
```
#define VM_ALLOC_COUNT(count)… | |||||
Done Inline ActionsYes something along this line for VM_ALLOC_COUNT(). If vm/vm_page.h is used in usermode (even rarely) then __extension__ would be useful/needed as well. kib: Yes something along this line for VM_ALLOC_COUNT(). If vm/vm_page.h is used in usermode (even… | |||||
Done Inline ActionsThis chunk is kernel-only. I am not 100% sure about adding the assertion, it means that VM_ALLOC_COUNT() cannot be assigned to a global var. But I don't think this is likely to arise... markj: This chunk is kernel-only.
I am not 100% sure about adding the assertion, it means that… | |||||
#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; | ||||
▲ Show 20 Lines • Show All 468 Lines • Show Last 20 Lines |
Could this be VM_ALLOC_COUNT(VM_ALLOC_COUNT_MAX - 1) and count < VM_ALLOC_COUNT_MAX could be used for assert in VM_ALLOC_COUNT?