summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@debian.org>2002-11-07 00:56:27 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-11-07 00:56:27 -0800
commit8aa1cb75c8799520a0734df53ea6940464b0add3 (patch)
tree6ad07e115077c2afcf4cb9b0f342d50c9aae14d6
parent4c312efdd5028c684bf978ff593945a76b934758 (diff)
[PATCH] CONFIG_STACK_GROWSUP
Change ARCH_STACK_GROWSUP to CONFIG_STACK_GROWSUP as requested.
-rw-r--r--arch/parisc/Kconfig4
-rw-r--r--fs/binfmt_elf.c4
-rw-r--r--fs/exec.c4
-rw-r--r--include/asm-parisc/pgtable.h2
-rw-r--r--include/linux/mm.h6
-rw-r--r--mm/mmap.c2
6 files changed, 14 insertions, 8 deletions
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index d5b4ddcae945..417ad6004c86 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -22,6 +22,10 @@ config SWAP
bool
default y
+config STACK_GROWSUP
+ bool
+ default y
+
config UID16
bool
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 20a1e5ecc08d..4d709ff63bfa 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -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
diff --git a/fs/exec.c b/fs/exec.c
index 03dbde9cd077..4ce313a15bfd 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -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);
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index 97a631e99110..acdd886998fe 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -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 >=
diff --git a/include/linux/mm.h b/include/linux/mm.h
index bef259292073..d91bd3e8ce14 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -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
diff --git a/mm/mmap.c b/mm/mmap.c
index ea28581a6148..37202059e4f6 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -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.
*/