Commit 8aa1cb75 authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] CONFIG_STACK_GROWSUP

Change ARCH_STACK_GROWSUP to CONFIG_STACK_GROWSUP as requested.
parent 4c312efd
......@@ -22,6 +22,10 @@ config SWAP
bool
default y
config STACK_GROWSUP
bool
default y
config UID16
bool
......
......@@ -109,7 +109,7 @@ static void padzero(unsigned long elf_bss)
}
/* Let's use some macros to make this stack manipulation a litle clearer */
#ifdef ARCH_STACK_GROWSUP
#ifdef CONFIG_STACK_GROWSUP
#define STACK_ADD(sp, items) ((elf_addr_t *)(sp) + (items))
#define STACK_ROUND(sp, items) \
((15 + (unsigned long) ((sp) + (items))) &~ 15UL)
......@@ -207,7 +207,7 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr * exec,
bprm->p = STACK_ROUND(sp, items);
/* Point sp at the lowest address on the stack */
#ifdef ARCH_STACK_GROWSUP
#ifdef CONFIG_STACK_GROWSUP
sp = (elf_addr_t *)bprm->p - items - ei_index;
bprm->exec = (unsigned long) sp; /* XXX: PARISC HACK */
#else
......
......@@ -331,7 +331,7 @@ int setup_arg_pages(struct linux_binprm *bprm)
struct mm_struct *mm = current->mm;
int i;
#ifdef ARCH_STACK_GROWSUP
#ifdef CONFIG_STACK_GROWSUP
/* Move the argument and environment strings to the bottom of the
* stack space.
*/
......@@ -390,7 +390,7 @@ int setup_arg_pages(struct linux_binprm *bprm)
down_write(&mm->mmap_sem);
{
mpnt->vm_mm = mm;
#ifdef ARCH_STACK_GROWSUP
#ifdef CONFIG_STACK_GROWSUP
mpnt->vm_start = stack_base;
mpnt->vm_end = PAGE_MASK &
(PAGE_SIZE - 1 + (unsigned long) bprm->p);
......
......@@ -13,8 +13,6 @@
#include <asm/cache.h>
#include <asm/bitops.h>
#define ARCH_STACK_GROWSUP
/*
* kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
* memory. For the return value to be meaningful, ADDR must be >=
......
......@@ -106,7 +106,11 @@ struct vm_area_struct {
#define VM_ACCOUNT 0x00100000 /* Is a VM accounted object */
#define VM_HUGETLB 0x00400000 /* Huge TLB Page VM */
#define VM_STACK_FLAGS (0x00000100 | VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT)
#ifdef CONFIG_STACK_GROWSUP
#define VM_STACK_FLAGS (VM_GROWSUP | VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT)
#else
#define VM_STACK_FLAGS (VM_GROWSDOWN | VM_DATA_DEFAULT_FLAGS | VM_ACCOUNT)
#endif
#define VM_READHINTMASK (VM_SEQ_READ | VM_RAND_READ)
#define VM_ClearReadHint(v) (v)->vm_flags &= ~VM_READHINTMASK
......
......@@ -767,7 +767,7 @@ struct vm_area_struct * find_vma_prev(struct mm_struct * mm, unsigned long addr,
return prev ? prev->vm_next : vma;
}
#ifdef ARCH_STACK_GROWSUP
#ifdef CONFIG_STACK_GROWSUP
/*
* vma is the first one with address > vma->vm_end. Have to extend vma.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment