Changeset View
Changeset View
Standalone View
Standalone View
sys/amd64/include/vmparam.h
Context not available. | |||||
#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 USRSTACK (SHAREDPAGE - 4*PAGE_SIZE) | ||||
op: Hi Robert!
- Show quoted text -
The SHAREDPAGE - 4*PAGE_SIZE constant is for separate the stack… | |||||
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… | |||||
#define VM_MAX_ADDRESS UPT_MAX_ADDRESS | #define VM_MAX_ADDRESS UPT_MAX_ADDRESS | ||||
#define VM_MIN_ADDRESS (0) | #define VM_MIN_ADDRESS (0) | ||||
Context not available. | |||||
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. |
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.