[uClinux-dev] [PATCH] : Avoid filename < TASK_SIZE test in do_getname() when no MMU

Philippe De Muyter phdm at macqel.be
Mon May 24 12:06:48 EDT 2010


On Mon, May 24, 2010 at 04:59:18PM +0100, David Howells wrote:
> Philippe De Muyter <phdm at macqel.be> wrote:
> 
> > > +#else
> > > +#define TASK_SIZE	(0xFFFFFFFFUL)
> > > +#endif
> > 
> > Because of do_getname() :
> > 
> > 	len = TASK_SIZE - (unsigned long) filename;
> > 
> > we should rather have
> > 
> > 	#define TASK_SIZE (0x100000000ull)
> 
> Do you guarantee that will work everywhere on a 32-bit system, though?
> 
> Note that it also makes things slower as gcc has to start using 64-bit
> arithmetic where it could otherwise use 32-bit arithmetic.

Except if gcc notices that this simplifies to

	len = (unsigned long)(-filename);

I don't know if it does.

Philippe

-- 
Philippe De Muyter  phdm at macqel dot be  Tel +32 27029044
Macq Electronique SA  rue de l'Aeronef 2  B-1140 Bruxelles  Fax +32 27029077



More information about the uClinux-dev mailing list