This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Functions to consume CPU time in x86
- To: ecos-discuss at sourceware dot cygnus dot com
- Subject: Re: [ECOS] Functions to consume CPU time in x86
- From: Hugo Tyson <hmt at redhat dot com>
- Date: 29 Mar 2001 11:56:11 +0100
- Newsgroups: cygnus.sourceware.ecos.d
- Organization: Red Hat UK
- References: <Pine.SOL.4.20.0103281020370.10015-100000@washoe.ics.uci.edu>
Cristiano Ligieri Pereira <cpereira@ics.uci.edu> writes:
> I need to implement some functions to keep the CPU busy for some amounts
> of time. I know that one way to do that is to build loops that do nothing
> other than keep the CPU busy. I would like to have functions to consume
> hundreds or thousands of nanoseconds of CPU time in x86 platform. Has
> anyone done this before? If so, would you be up to provide me such
> functions?
There is something in the net tests, in net/tcpip/VERSION/tests/tcp_echo.c
that keeps the CPU busy a certain *percentage* of its capability.
Not what you asked for, but you might find it of interest - especially the
way it calibrates itself for differing platforms, which might be useful to
you in this?
Doesn't hal_delay_us(int) AKA CYGACC_CALL_IF_DELAY_US(_u_) via virtual
vectors do almost what you want? It's defined to be a busy wait. It's in
uS not nS, but it should be another place to start.
- Huge