Re: Prezeroing V2 [2/4]: add second parameter to clear_page() forall arches

From: Christoph Lameter
Date: Mon Jan 03 2005 - 13:04:43 EST


On Fri, 24 Dec 2004, David S. Miller wrote:

> On Thu, 23 Dec 2004 11:33:59 -0800 (PST)
> Christoph Lameter <clameter@xxxxxxx> wrote:
>
> > Modification made but it would be good to have some feedback from the arch maintainers:
> >
> ...
> > sparc64
>
> I don't see any sparc64 bits in this patch, else I'd
> review them :-)
>

Sorry here it is:

Index: linux-2.6.9/include/asm-sparc64/page.h
===================================================================
--- linux-2.6.9.orig/include/asm-sparc64/page.h 2004-10-18 14:53:51.000000000 -0700
+++ linux-2.6.9/include/asm-sparc64/page.h 2005-01-03 09:50:16.000000000 -0800
@@ -15,7 +15,17 @@
#ifndef __ASSEMBLY__

extern void _clear_page(void *page);
-#define clear_page(X) _clear_page((void *)(X))
+
+static void inline clear_page(void *page, int order)
+{
+ unsigned int nr = 1 << order;
+
+ while (nr-- > 0) {
+ _clear_page(page);
+ page += PAGE_SIZE;
+ }
+}
+
struct page;
extern void clear_user_page(void *addr, unsigned long vaddr, struct page *page);
#define copy_page(X,Y) memcpy((void *)(X), (void *)(Y), PAGE_SIZE)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/