* [ECOS] DEVIO table change
@ 2000-12-11 9:10 Grant Edwards
2000-12-11 9:27 ` Bart Veer
0 siblings, 1 reply; 3+ messages in thread
From: Grant Edwards @ 2000-12-11 9:10 UTC (permalink / raw)
To: ecos-discuss
How do I determine (at compile time) with which version of the
kernel a driver is being used?
Maintaining parallel drivers for 1.3.1 and CVS would require a
lot of work, so I'd like my driver to work with both 1.3.1 and
CVS code. But the DEVIO table has changed. I can't seem to
find a kernel version or devio version macro to test in my
driver sources to determine whether to include a select
function in the DEVIO macro.
It looks like I might be able to make the decision on whether
CHAR_DEVIO_TABLE is defined.
Would it be possible to include some sort of kernel version or
kernel API version macro in the one of the eCos kernel header
files so that a single driver can support multiple versions of
the kernel?
--
Grant Edwards
grante@visi.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ECOS] DEVIO table change
2000-12-11 9:10 [ECOS] DEVIO table change Grant Edwards
@ 2000-12-11 9:27 ` Bart Veer
2000-12-11 13:39 ` Jonathan Larmour
0 siblings, 1 reply; 3+ messages in thread
From: Bart Veer @ 2000-12-11 9:27 UTC (permalink / raw)
To: grante; +Cc: ecos-discuss
>>>>> "Grant" == Grant Edwards <grante@visi.com> writes:
Grant> How do I determine (at compile time) with which version of
Grant> the kernel a driver is being used?
Grant> Maintaining parallel drivers for 1.3.1 and CVS would
Grant> require a lot of work, so I'd like my driver to work with
Grant> both 1.3.1 and CVS code. But the DEVIO table has changed. I
Grant> can't seem to find a kernel version or devio version macro
Grant> to test in my driver sources to determine whether to
Grant> include a select function in the DEVIO macro.
Grant> It looks like I might be able to make the decision on
Grant> whether CHAR_DEVIO_TABLE is defined.
Grant> Would it be possible to include some sort of kernel version
Grant> or kernel API version macro in the one of the eCos kernel
Grant> header files so that a single driver can support multiple
Grant> versions of the kernel?
Actually, the kernel version macros do exist:
#include <pkgconf/system.h>
#ifdef CYGPKG_KERNEL_CURRENT
...
#endif
With current versions of the host-side tools there will also be
definitions for CYGNUM_KERNEL_VERSION_MAJOR, _MINOR and _RELEASE which
can be used for numerical comparisons in a #if, but that functionality
was added after the 1.3.1 release.
Bart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [ECOS] DEVIO table change
2000-12-11 9:27 ` Bart Veer
@ 2000-12-11 13:39 ` Jonathan Larmour
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Larmour @ 2000-12-11 13:39 UTC (permalink / raw)
To: bartv; +Cc: grante, ecos-discuss
Bart Veer wrote:
>
> >>>>> "Grant" == Grant Edwards <grante@visi.com> writes:
>
> Grant> Would it be possible to include some sort of kernel version
> Grant> or kernel API version macro in the one of the eCos kernel
> Grant> header files so that a single driver can support multiple
> Grant> versions of the kernel?
>
> Actually, the kernel version macros do exist:
>
> #include <pkgconf/system.h>
> #ifdef CYGPKG_KERNEL_CURRENT
> ...
> #endif
>
> With current versions of the host-side tools there will also be
> definitions for CYGNUM_KERNEL_VERSION_MAJOR, _MINOR and _RELEASE which
> can be used for numerical comparisons in a #if, but that functionality
> was added after the 1.3.1 release.
But that's okay, because if those macros aren't defined, you know it's too
old :-).
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-12-11 13:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-11 9:10 [ECOS] DEVIO table change Grant Edwards
2000-12-11 9:27 ` Bart Veer
2000-12-11 13:39 ` Jonathan Larmour
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).