[ECOS] Problem compiling newnet with timing stats
Paul Randall
prandall@delta-info.com
Fri Jun 14 14:02:00 GMT 2002
Hi all,
I am having problems compiling the newnet (FreeBSD) template with
CYGDBG_NET_TIMING_STATS turned on in eCos 2.0. I can compile and run
the original TCP/IP stack (OpenBSD) with timing stats with no problem.
During the make for newnet, I get the following errors:
In file included from
/ecos-c/cygwin/src/ecos2a/ecos/newnet/install/include/sys/param.h:820,
from
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:56:
/ecos-c/cygwin/src/ecos2a/ecos/newnet/install/include/cyg/kernel/kapi.h:360:
warning: function declaration isn't a prototype
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:
In function `cyg_net_malloc':
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:197:
parse error before `start_time'
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:197:
`start_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:197:
(Each undeclared identifier is reported only once
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:197:
for each function it appears in.)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:203:
`end_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:203:
`elapsed_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:
In function `cyg_net_mbuf_alloc':
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:222:
parse error before `start_time'
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:222:
`start_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:229:
`end_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:229:
`elapsed_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:
In function `cyg_net_cluster_alloc':
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:251:
parse error before `start_time'
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:251:
`start_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:253:
`end_time' undeclared (first use in this function)
/ecos-c/cygwin/src/ecos2a/ecos/packages/net/bsd_tcpip/current/src/ecos/support.c:253:
`elapsed_time' undeclared (first use in this function)
make[1]: *** [src/ecos/support.o.d] Error 1
make[1]: Leaving directory
`/src/ecos2a/ecos/newnet/net/bsd_tcpip/current'
make: *** [build] Error 2
It looks like the compile errors are coming from the START_STATS() and
FINISH_STATS() macros in param.h:
#ifdef CYGDBG_NET_TIMING_STATS
#define START_STATS() \
cyg_uint32 start_time, end_time, elapsed_time; \
HAL_CLOCK_READ(&start_time);
#define
FINISH_STATS(stats)
\
HAL_CLOCK_READ(&end_time);
\
if (end_time < start_time)
{ \
elapsed_time = (end_time+CYGNUM_KERNEL_COUNTERS_RTC_PERIOD) -
start_time; \
} else
{
\
elapsed_time = end_time -
start_time; \
}
\
if (stats.min_time == 0)
{ \
stats.min_time =
0x7FFFFFFF; \
}
\
if (elapsed_time <
stats.min_time) \
stats.min_time =
elapsed_time; \
if (elapsed_time >
stats.max_time) \
stats.max_time =
elapsed_time; \
stats.total_time +=
elapsed_time; \
stats.count++;
#else
#define START_STATS()
#define FINISH_STATS(X)
#endif
I tried moving the "cyg_uint32 start_time, end_time, elapsed_time;" line
before the "#define START_STATS()" and the template compiled ok, but
when I went to run a test, my viper locked up during the ethernet
initialization.
Any suggestions?
Paul Randall
Delta Information Systems
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list