Skip to contentSkip to conversation

Patch for o32/n32 mmap on 64-bit kernel

PATCH Daniel Jacobowitz 3 participants 3 messages Mar 8, 2004 – Mar 17, 2004 MIPS

lore
Share & tools
lore
#0 lore raw

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

syscall.c +6 -3
diff -u -p -r1.4.8.1 syscall.c
@@ -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;
Signature · 2 lines
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer
#1 lore raw
Quoted 2 lines · Daniel Jacobowitz

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

#2 lore raw
Quoted 4 lines · Ralf Baechle
Quoted 2 lines

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.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +