This is the mail archive of the mailing list for the eCos project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: timer functions for non-kernel

>>>>> "Jani" == Jani Monoses <> 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     The eCos and RedBoot experts

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]