[U-Boot-Users] PATCH: fix timer overflow in DaVinci

Wolfgang Denk wd at denx.de
Tue Oct 16 22:46:33 CEST 2007


In message <265CBF1670611D47B47E67959D02EBE3C381D8 at mngilex001.Jerusalem.mangodsp.com> you wrote:
>
> The get_timer() function in DaVinci's timer.c doesn't handle overflow --
> it simply subtracts the "base" from the current time, but if the timer
> overflowed and the current time is smaller than base, a negative number
> results. The attached patch fixes that.

I think this is the wrong approach. get_timer() should not have to
deal with wrap arounds, because get_timer_masked() is suppsoed to
handle this internally. So please fix it there.

When reposting, please don't forhet to add your Signed-off-by: line.

> Content-Type: text/plain;
> 	name="timer-patch.txt"
> Content-Transfer-Encoding: base64
> Content-Description: timer-patch.txt
> Content-Disposition: attachment;
> 	filename="timer-patch.txt"
> 
> LS0tIGNwdS9hcm05MjZlanMvZGF2aW5jaS90aW1lci5jLm9yaWcJMjAwNy0xMC0xNiAyMTo1OTow
> MS4wMDAwMDAwMDAgKzAyMDAKKysrIGNwdS9hcm05MjZlanMvZGF2aW5jaS90aW1lci5jCTIwMDct
> MDktMTEgMjE6NTM6MDMuMDAwMDAwMDAwICswMzAwCkBAIC04Niw3ICs4NiwxMCBAQAogCiB1bG9u
> ZyBnZXRfdGltZXIodWxvbmcgYmFzZSkKIHsKLQlyZXR1cm4oZ2V0X3RpbWVyX21hc2tlZCgpIC0g
> YmFzZSk7CisJdWxvbmcgZ3RtID0gZ2V0X3RpbWVyX21hc2tlZCgpOworCWlmKGd0bSA8IGJhc2Up
> ICAvKiBvdmVyZmxvdzsgYXNzdW1lIG5vIG1vcmUgdGhhbiBvbmUgLS0gMTU5IHNlY29uZHMgKi8K
> KwkJZ3RtICs9ICgweGZmZmZmZmZmVUwgLyBUSU1FUl9MT0FEX1ZBTCk7CisJcmV0dXJuIGd0bSAt
> IGJhc2U7CiB9CiAKIHZvaWQgc2V0X3RpbWVyKHVsb25nIHQpCg==

And send your patch inline and as plain text, not as a base64 encoded
attachment.

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: wd at denx.de
Superior ability breeds superior ambition.
	-- Spock, "Space Seed", stardate 3141.9




More information about the U-Boot mailing list