aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/sys_sparc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-03-17 20:33:56 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-20 04:16:36 -0500
commitd61e16df940e02e25679bdc1aee8c25786f6de90 (patch)
treede76f4007d526835b8564203341ebf66ca29b12d /arch/sparc64/kernel/sys_sparc.c
parenta91690ddd05ab0b7fbdd37733875525ac75c20f2 (diff)
[SPARC64]: Increase top of 32-bit process stack.
Put it one page below the top of the 32-bit address space. This gives us ~16MB more address space to work with. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/sys_sparc.c')
-rw-r--r--arch/sparc64/kernel/sys_sparc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 61dffb9349bd..9019b41fc02a 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -30,6 +30,7 @@
30#include <asm/ipc.h> 30#include <asm/ipc.h>
31#include <asm/utrap.h> 31#include <asm/utrap.h>
32#include <asm/perfctr.h> 32#include <asm/perfctr.h>
33#include <asm/a.out.h>
33 34
34/* #define DEBUG_UNIMP_SYSCALL */ 35/* #define DEBUG_UNIMP_SYSCALL */
35 36
@@ -130,7 +131,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi
130 } 131 }
131 132
132 if (test_thread_flag(TIF_32BIT)) 133 if (test_thread_flag(TIF_32BIT))
133 task_size = 0xf0000000UL; 134 task_size = STACK_TOP32;
134 if (unlikely(len > task_size || len >= VA_EXCLUDE_START)) 135 if (unlikely(len > task_size || len >= VA_EXCLUDE_START))
135 return -ENOMEM; 136 return -ENOMEM;
136 137
@@ -203,7 +204,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
203{ 204{
204 struct vm_area_struct *vma; 205 struct vm_area_struct *vma;
205 struct mm_struct *mm = current->mm; 206 struct mm_struct *mm = current->mm;
206 unsigned long task_size = 0xf0000000UL; 207 unsigned long task_size = STACK_TOP32;
207 unsigned long addr = addr0; 208 unsigned long addr = addr0;
208 int do_color_align; 209 int do_color_align;
209 210
@@ -370,7 +371,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
370 mm->unmap_area = arch_unmap_area; 371 mm->unmap_area = arch_unmap_area;
371 } else { 372 } else {
372 /* We know it's 32-bit */ 373 /* We know it's 32-bit */
373 unsigned long task_size = 0xf0000000UL; 374 unsigned long task_size = STACK_TOP32;
374 unsigned long gap; 375 unsigned long gap;
375 376
376 gap = current->signal->rlim[RLIMIT_STACK].rlim_cur; 377 gap = current->signal->rlim[RLIMIT_STACK].rlim_cur;
@@ -388,7 +389,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
388asmlinkage unsigned long sparc_brk(unsigned long brk) 389asmlinkage unsigned long sparc_brk(unsigned long brk)
389{ 390{
390 /* People could try to be nasty and use ta 0x6d in 32bit programs */ 391 /* People could try to be nasty and use ta 0x6d in 32bit programs */
391 if (test_thread_flag(TIF_32BIT) && brk >= 0xf0000000UL) 392 if (test_thread_flag(TIF_32BIT) && brk >= STACK_TOP32)
392 return current->mm->brk; 393 return current->mm->brk;
393 394
394 if (unlikely(straddles_64bit_va_hole(current->mm->brk, brk))) 395 if (unlikely(straddles_64bit_va_hole(current->mm->brk, brk)))
@@ -554,10 +555,10 @@ asmlinkage unsigned long sys_mmap(unsigned long addr, unsigned long len,
554 retval = -EINVAL; 555 retval = -EINVAL;
555 556
556 if (test_thread_flag(TIF_32BIT)) { 557 if (test_thread_flag(TIF_32BIT)) {
557 if (len >= 0xf0000000UL) 558 if (len >= STACK_TOP32)
558 goto out_putf; 559 goto out_putf;
559 560
560 if ((flags & MAP_FIXED) && addr > 0xf0000000UL - len) 561 if ((flags & MAP_FIXED) && addr > STACK_TOP32 - len)
561 goto out_putf; 562 goto out_putf;
562 } else { 563 } else {
563 if (len >= VA_EXCLUDE_START) 564 if (len >= VA_EXCLUDE_START)