Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Patch for o32/n32 mmap on 64-bit kernel
@ 2004-03-08 21:46 Daniel Jacobowitz
  2004-03-09  4:21 ` Ralf Baechle
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2004-03-08 21:46 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

As discussed.  Applies to linux-2.4 cleanly, to linux-2.6 also but you'll
need to add:

#if CONFIG_MIPS32
	task_size = TASK_SIZE;
#else


Index: syscall.c
===================================================================
RCS file: /cvsdev/mvl-kernel/linux/arch/mips64/kernel/syscall.c,v
retrieving revision 1.4.8.1
diff -u -p -r1.4.8.1 syscall.c
--- syscall.c	17 Nov 2003 16:29:20 -0000	1.4.8.1
+++ syscall.c	8 Mar 2004 21:43:06 -0000
@@ -61,6 +61,9 @@ unsigned long arch_get_unmapped_area(str
 {
 	struct vm_area_struct * vmm;
 	int do_color_align;
+	unsigned long task_size;
+	
+	task_size = (current->thread.mflags & MF_32BIT_ADDR) ? TASK_SIZE32 : TASK_SIZE;
 
 	if (flags & MAP_FIXED) {
 		/*
@@ -72,7 +75,7 @@ unsigned long arch_get_unmapped_area(str
 		return addr;
 	}
 
-	if (len > TASK_SIZE)
+	if (len > task_size)
 		return -ENOMEM;
 	do_color_align = 0;
 	if (filp || (flags & MAP_SHARED))
@@ -83,7 +86,7 @@ unsigned long arch_get_unmapped_area(str
 		else
 			addr = PAGE_ALIGN(addr);
 		vmm = find_vma(current->mm, addr);
-		if (TASK_SIZE - len >= addr &&
+		if (task_size - len >= addr &&
 		    (!vmm || addr + len <= vmm->vm_start))
 			return addr;
 	}
@@ -95,7 +98,7 @@ unsigned long arch_get_unmapped_area(str
 
 	for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
 		/* At this point:  (!vmm || addr < vmm->vm_end). */
-		if (TASK_SIZE - len < addr)
+		if (task_size - len < addr)
 			return -ENOMEM;
 		if (!vmm || addr + len <= vmm->vm_start)
 			return addr;


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch for o32/n32 mmap on 64-bit kernel
  2004-03-08 21:46 Patch for o32/n32 mmap on 64-bit kernel Daniel Jacobowitz
@ 2004-03-09  4:21 ` Ralf Baechle
  2004-03-17 16:22   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Ralf Baechle @ 2004-03-09  4:21 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: linux-mips

On Mon, Mar 08, 2004 at 04:46:30PM -0500, Daniel Jacobowitz wrote:

> As discussed.  Applies to linux-2.4 cleanly, to linux-2.6 also but you'll
> need to add:

Thanks for doing all the work.  Applied,

   Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Patch for o32/n32 mmap on 64-bit kernel
  2004-03-09  4:21 ` Ralf Baechle
@ 2004-03-17 16:22   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2004-03-17 16:22 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: linux-mips

On Tue, 9 Mar 2004, Ralf Baechle wrote:

> > As discussed.  Applies to linux-2.4 cleanly, to linux-2.6 also but you'll
> > need to add:
> 
> Thanks for doing all the work.  Applied,

 Thanks from me, too -- it was on my to-do list.  It should fix at least
one configure script misbehavior -- I'll check if it really does.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-17 16:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-08 21:46 Patch for o32/n32 mmap on 64-bit kernel Daniel Jacobowitz
2004-03-09  4:21 ` Ralf Baechle
2004-03-17 16:22   ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox