This is the mail archive of the
mailing list for the eCos project.
Re: timer functions for non-kernel
- From: Bart Veer <bartv at ecoscentric dot com>
- To: jani at iv dot ro
- Cc: ecos-patches at ecos dot sourceware dot org
- Date: Fri, 26 Nov 2004 16:12:18 +0000 (GMT)
- Subject: Re: timer functions for non-kernel
- References: <41A73012.email@example.com>
>>>>> "Jani" == Jani Monoses <firstname.lastname@example.org> writes:
Jani> This adds cyg_thread_delay() and cyg_current_time()
Jani> functions to the drv_api for compatibility with the kernel
Jani> config, so apps don't need to #ifdef on CYGPKG_KERNEL.
Jani> Does the idea and the code seem OK?
The driver API was meant to operate even in scenarios where interrupts
are kept permanently disabled and all I/O happens via polling, e.g.
RedBoot. It reduces the effort needed inside device drivers to cope
with the various scenarios, and thus allows these device drivers to be
shared by eCos and RedBoot. It is debatable whether or not the cure is
worse than the problem.
Application code is much less likely to suffer from confusion because
the choice of whether or not to use the kernel usually gets made very
early in the application design phase.
The functions in this patch will only work in scenarios are kept
enabled most or all of the time, which won't be the case in e.g.
RedBoot. Otherwise they'll fail silently. I think it is a bad idea to
have such functions in the system. The kernel ones are different
because the kernel can expect the system to be running with interrupts
enabled nearly all the time.
Bart Veer eCos Configuration Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts