Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/vmparam.h
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Lines | |||||
#define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4BASE, 0, 0, 0) | #define VM_MIN_KERNEL_ADDRESS KVADDR(KPML4BASE, 0, 0, 0) | ||||
#define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4BASE + NKPML4E - 1, \ | #define VM_MAX_KERNEL_ADDRESS KVADDR(KPML4BASE + NKPML4E - 1, \ | ||||
NPDPEPG-1, NPDEPG-1, NPTEPG-1) | NPDPEPG-1, NPDEPG-1, NPTEPG-1) | ||||
#define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0) | #define DMAP_MIN_ADDRESS KVADDR(DMPML4I, 0, 0, 0) | ||||
#define DMAP_MAX_ADDRESS KVADDR(DMPML4I + NDMPML4E, 0, 0, 0) | #define DMAP_MAX_ADDRESS KVADDR(DMPML4I + NDMPML4E, 0, 0, 0) | ||||
#define KERNBASE KVADDR(KPML4I, KPDPI, 0, 0) | #define KERNBASE KVADDR(KPML4I, KPDPI, 0, 0) | ||||
op: Hi Robert!
- Show quoted text -
The SHAREDPAGE - 4*PAGE_SIZE constant is for separate the stack… | |||||
#define UPT_MAX_ADDRESS KVADDR(PML4PML4I, PML4PML4I, PML4PML4I, PML4PML4I) | #define UPT_MAX_ADDRESS KVADDR(PML4PML4I, PML4PML4I, PML4PML4I, PML4PML4I) | ||||
#define UPT_MIN_ADDRESS KVADDR(PML4PML4I, 0, 0, 0) | #define UPT_MIN_ADDRESS KVADDR(PML4PML4I, 0, 0, 0) | ||||
#define VM_MAXUSER_ADDRESS UVADDR(NUPML4E, 0, 0, 0) | #define VM_MAXUSER_ADDRESS UVADDR(NUPML4E, 0, 0, 0) | ||||
#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) | #define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) | ||||
#define USRSTACK SHAREDPAGE | #define SHAREDPAGE_GUARD (4 * PAGE_SIZE) | ||||
#define USRSTACK (SHAREDPAGE - SHAREDPAGE_GUARD) | |||||
Not Done Inline ActionsPlease add a comment explaining the magic number '4', and ideally use a #define that makes the choice obvious as well. A bare number is almost never the right thing. rwatson: Please add a comment explaining the magic number '4', and ideally use a #define that makes the… | |||||
Not Done Inline ActionsIs the comment explaining (4) now elsewhere? I've not spotted it yet. rwatson: Is the comment explaining (4) now elsewhere? I've not spotted it yet. | |||||
#define VM_MAX_ADDRESS UPT_MAX_ADDRESS | #define VM_MAX_ADDRESS UPT_MAX_ADDRESS | ||||
#define VM_MIN_ADDRESS (0) | #define VM_MIN_ADDRESS (0) | ||||
/* | /* | ||||
* XXX Allowing dmaplimit == 0 is a temporary workaround for vt(4) efifb's | * XXX Allowing dmaplimit == 0 is a temporary workaround for vt(4) efifb's | ||||
* early use of PHYS_TO_DMAP before the mapping is actually setup. This works | * early use of PHYS_TO_DMAP before the mapping is actually setup. This works | ||||
* because the result is not actually accessed until later, but the early | * because the result is not actually accessed until later, but the early | ||||
* vt fb startup needs to be reworked. | * vt fb startup needs to be reworked. | ||||
Show All 38 Lines |
Hi Robert!
The SHAREDPAGE - 4*PAGE_SIZE constant is for separate the stack and
the shared page, because the shared-page are double mapped with kernel
and user-space, and the shared-page and stack are overlapped. This
means, when stack become read-write-executable (in firefox case it's
RWX), then the shared-page became too. To avoid this case, I separated
it from stack with 4 page.