This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
delay_us()
- From: Motoya Kurotsu <kurotsu at allied-telesis dot co dot jp>
- To: ecos-discuss at sources dot redhat dot com
- Date: Mon, 17 Mar 2003 16:05:37 +0900
- Subject: [ECOS] delay_us()
Hi all;
I would like to ask you how to think about the following issue.
The delay_us() take cares the large number of delay without kernel,
calling hal_delay_us() -- at least in mips architecture -- but not do so
with kernel. I think that it should not vary how to take care the large number
of delay depending on the use of kernel. Considering that some ethernet
drivers actually use this function with the value of several seconds,
I think that delay_us() should take care of the large number of delay
as well with the kernel.
Please tell me how you think ahout it?
The attachment is just an example to clarify the overflow issue.
3/17/03
Motoya Kurotsu
Allied Telesis K.K.
--- hal_if.c.orig Mon Mar 17 15:08:38 2003
+++ hal_if.c Mon Mar 17 15:39:38 2003
@@ -125,10 +125,10 @@
#ifdef CYGPKG_KERNEL
{
cyg_int32 start, elapsed;
- cyg_int32 usec_ticks, slice;
+ cyg_int64 usec_ticks, slice;
// How many ticks total we should wait for.
- usec_ticks = usecs*CYGNUM_KERNEL_COUNTERS_RTC_PERIOD;
+ usec_ticks = (cyg_int64)usecs*CYGNUM_KERNEL_COUNTERS_RTC_PERIOD;
usec_ticks /= CYGNUM_HAL_RTC_NUMERATOR/CYGNUM_HAL_RTC_DENOMINATOR/1000;
do {
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss