Changeset d1e8440 in mainline


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().
Location:
kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/include/mm/as.h

    r57355a40 rd1e8440  
    4343#define USER_ADDRESS_SPACE_END_ARCH      UINT64_C(0xdfffffffffffffff)
    4444
    45 #define USTACK_ADDRESS_ARCH  UINT64_C(0x0000000ff0000000)
    46 
    4745typedef struct {
    4846} as_arch_t;
  • kernel/generic/include/mm/as.h

    r57355a40 rd1e8440  
    6161#define USER_ADDRESS_SPACE_END      USER_ADDRESS_SPACE_END_ARCH
    6262
    63 #ifdef USTACK_ADDRESS_ARCH
    64         #define USTACK_ADDRESS  USTACK_ADDRESS_ARCH
    65 #else
    66         #define USTACK_ADDRESS  (USER_ADDRESS_SPACE_END - (STACK_SIZE - 1))
    67 #endif
    68 
    6963/** Kernel address space. */
    7064#define FLAG_AS_KERNEL  (1 << 0)
  • 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.