Dear Reinhard Meyer, In message <4cc66eca.9000...@emk-elektronik.de> you wrote: > > Agreed here. People are invited to dig through u-boot and find all > those places.
You know the ones you added best :-) > > int main(void) > > { > > unsigned int time = 0xFFFFFFF0; > > unsigned int delay = 0x20; > > unsigned int start; > > You are wrong here, because you take it out of context. I am not wrong. Feel free to replace "unsigned int" by "unsigned long long", and 0xFFFFFFF0 by 0xFFFFFFFFFFFFFFF0ULL, and the "%X" by "%llX". > My "demo" is using the (declared as) 64 bit function get_ticks(). > I mentioned above that this function MUST be truly returning 64 > bits worth of (incrementing) value to make any version work. What's the difference? It is inherently wrong to believe an overflow would never occur just because the precision of a number is "long enough". Remeber y2k issues. Remember the time overflog for UNIX systems in 2038, etc. etc. > If get_ticks() just returns a 32 bit counter value neither method will work > reliably. Just check all implementations that this function is implemented > correctly. No, the code is still WRONG. It'ss just that the problem is less likely to hit. BTW - who says the timer starts counting at 0 ? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Lack of skill dictates economy of style. - Joey Ramone _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot