]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] CONFIG_STACK_GROWSUP
authorMatthew Wilcox <willy@debian.org>
Thu, 7 Nov 2002 08:56:27 +0000 (00:56 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Thu, 7 Nov 2002 08:56:27 +0000 (00:56 -0800)
Change ARCH_STACK_GROWSUP to CONFIG_STACK_GROWSUP as requested.

arch/parisc/Kconfig
fs/binfmt_elf.c
fs/exec.c
include/asm-parisc/pgtable.h
include/linux/mm.h
mm/mmap.c

index d5b4ddcae9450e680f10cf81a6c29da2e27b8a60..417ad6004c865566fb259533ffd3d6e10518170d 100644 (file)
@@ -22,6 +22,10 @@ config SWAP
        bool
        default y
 
+config STACK_GROWSUP
+       bool
+       default y
+
 config UID16
        bool
 
index 20a1e5ecc08d05ced1a8ba9fd486a7ff01153251..4d709ff63bfaeaf406e1afc6d9f58d5698a3fa35 100644 (file)
@@ -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
index 03dbde9cd0774f03b0319aeb11f1beec2653cd4b..4ce313a15bfd96817c8a88d0786efd4baac5d83d 100644 (file)
--- 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);
index 97a631e991109d637177c99aa0ebc60465d5baaa..acdd886998fe24e61bb4ac83bece6527b4cfd2f1 100644 (file)
@@ -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 >=
index bef2592920738ec3241e53898925500ca65f6a74..d91bd3e8ce144f69d2d21e6e9967175c09578a47 100644 (file)
@@ -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
index ea28581a614861ac4d578b858c01b255e7de3067..37202059e4f6f9924bcf8591b11c25dcc3bcf5a8 100644 (file)
--- 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.
  */