linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/4] nommu - backward compatibility patch for mm/nommu.c
@ 2005-05-07  8:12 Hyok S. Choi
  2005-05-09 10:01 ` [uClinux-dev] " David Howells
  0 siblings, 1 reply; 3+ messages in thread
From: Hyok S. Choi @ 2005-05-07  8:12 UTC (permalink / raw)
  To: Linux-Kernel List, uClinux development list

nommu patch against 2.6.12-rc3-mm3, for mm/nommu.c : 
- need to fix the vmalloc definition.
- most malloc functions in nommu does not provide the 'len'. should consider
"zero" len value.
 If it does return with error when the 'len' is zero, the whole exist
applications are unable to run, because of the std-c libraries for uClinux.

Signed-off-by : Hyok S. Choi <hyok.choi@samsung.com>

Index: linux-2.6.12-rc3-mm3/mm/nommu.c
================================================================
--- linux-2.6.12-rc3-mm3/mm/nommu.c	2005-05-06 09:58:44.000000000 +0900
+++ linux-2.6.12-rc3-mm3-hsc0/mm/nommu.c	2005-05-06
13:53:54.000000000 +0900
@@ -6,6 +6,7 @@
  *
  *  See Documentation/nommu-mmap.txt
  *
+ *  Copyright (c) 2005      Hyok S. Choi <hyok.choi@samsung.com>
  *  Copyright (c) 2004-2005 David Howells <dhowells@redhat.com>
  *  Copyright (c) 2000-2003 David McCullough <davidm@snapgear.com>
  *  Copyright (c) 2000-2001 D Jeff Dionne <jeff@uClinux.org>
@@ -146,7 +147,7 @@
 	kfree(addr);
 }
 
-void *__vmalloc(unsigned long size, int gfp_mask, pgprot_t prot)
+void *__vmalloc(unsigned long size, unsigned int gfp_mask, pgprot_t prot)
 {
 	/*
 	 * kmalloc doesn't like __GFP_HIGHMEM for some reason
@@ -901,10 +902,12 @@
 #ifdef DEBUG
 	printk("do_munmap:\n");
 #endif
-
+	/* if the len is zero(as some simple-malloc libs does),
+	 * treat it with the start addr only.
+	 */
 	for (parent = &mm->context.vmlist; *parent; parent =
&(*parent)->next)
 		if ((*parent)->vma->vm_start == addr &&
-		    (*parent)->vma->vm_end == end)
+		    (!len || (*parent)->vma->vm_end == end))
 			goto found;
 
 	printk("munmap of non-mmaped memory by process %d (%s): %p\n",
@@ -914,6 +917,9 @@
  found:
 	vml = *parent;
 
+	if(!len)
+		len = vml->vma->vm_end - addr;
+	
 	put_vma(vml->vma);
 
 	*parent = vml->next;


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

* Re: [uClinux-dev] [PATCH 4/4] nommu - backward compatibility patch for mm/nommu.c
  2005-05-07  8:12 [PATCH 4/4] nommu - backward compatibility patch for mm/nommu.c Hyok S. Choi
@ 2005-05-09 10:01 ` David Howells
  2005-05-09 12:44   ` Greg Ungerer
  0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2005-05-09 10:01 UTC (permalink / raw)
  To: uClinux development list; +Cc: Linux-Kernel List


Hyok S. Choi <hyok.choi@samsung.com> wrote:

> -		    (*parent)->vma->vm_end == end)
> +		    (!len || (*parent)->vma->vm_end == end))

Please make this configurable. It's bypassing an error case check.

David

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

* Re: [uClinux-dev] [PATCH 4/4] nommu - backward compatibility patch for mm/nommu.c
  2005-05-09 10:01 ` [uClinux-dev] " David Howells
@ 2005-05-09 12:44   ` Greg Ungerer
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Ungerer @ 2005-05-09 12:44 UTC (permalink / raw)
  To: uClinux development list; +Cc: Linux-Kernel List


David Howells wrote:
> Hyok S. Choi <hyok.choi@samsung.com> wrote:
> 
> 
>>-		    (*parent)->vma->vm_end == end)
>>+		    (!len || (*parent)->vma->vm_end == end))
> 
> 
> Please make this configurable. It's bypassing an error case check.

I disagree, I don't think it warrents yet another configuration option.

Most uClinux archiectures don't want to do this size error check - at
least any that rely on the current implementation of light weight uClibc
mmap() based malloc(). And up until recently this was _every_ uClinux
architecture.

Regards
Greg


------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg@snapgear.com
SnapGear -- a CyberGuard Company            PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com

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

end of thread, other threads:[~2005-05-09 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-07  8:12 [PATCH 4/4] nommu - backward compatibility patch for mm/nommu.c Hyok S. Choi
2005-05-09 10:01 ` [uClinux-dev] " David Howells
2005-05-09 12:44   ` Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).