On Tue, 2006-11-14 at 14:50 +1100, David Gibson wrote: > +/* Possibly these functions should go in the library itself.. */
Yes, exactly what I was going to suggest. These are sufficiently useful to other potential users that I think they should go in hugeutils.c from the start. Other than that, looks good to me. > +#ifdef __powerpc64__ > +void *next_chunk(void *addr) > +{ > + if ((unsigned long)addr < 0x100000000UL) > + /* 256M segments below 4G */ > + return PALIGN(addr, 0x10000000UL); > + else > + /* 1TB segments above */ > + return PALIGN(addr, 0x10000000000UL); > +} > +#elif __powerpc__ > +void *next_chunk(void *addr) > +{ > + return PALIGN(addr, 0x10000000UL); > +} > +#else > +void *next_chunk(void *addr) > +{ > + return PALIGN(addr, gethugepagesize()); > +} > +#endif -- Adam Litke - (agl at us.ibm.com) IBM Linux Technology Center ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Libhugetlbfs-devel mailing list Libhugetlbfs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel