Changeset d1e8440 in mainline for kernel/generic/src/proc/program.c


Ignore:
Timestamp:
2012-11-11T16:27:06Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6f5e213
Parents:
57355a40
Message:

Get rid of USTACK_ADDRESS.

  • Let the kernel find a suitable address itself.
  • Limit it to only one possibility using the bound argument of as_area_create().
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/proc/program.c

    r57355a40 rd1e8440  
    7979         * Create the stack address space area.
    8080         */
    81         uintptr_t virt = USTACK_ADDRESS;
     81        uintptr_t virt = (uintptr_t) -1;
     82        uintptr_t bound = USER_ADDRESS_SPACE_END - (STACK_SIZE_USER - 1);
     83
     84        /* Adjust bound to create space for the desired guard page. */
     85        bound -= PAGE_SIZE;
     86
    8287        as_area_t *area = as_area_create(as,
    8388            AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE | AS_AREA_GUARD |
    8489            AS_AREA_LATE_RESERVE, STACK_SIZE_USER, AS_AREA_ATTR_NONE,
    85             &anon_backend, NULL, &virt, 0);
     90            &anon_backend, NULL, &virt, bound);
    8691        if (!area) {
    8792                task_destroy(prg->task);
Note: See TracChangeset for help on using the changeset viewer.