This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: DEVIO table change
- To: grante at visi dot com
- Subject: Re: [ECOS] DEVIO table change
- From: Bart Veer <bartv at redhat dot com>
- Date: Mon, 11 Dec 2000 17:27:32 GMT
- CC: ecos-discuss at sources dot redhat dot com
- References: <20001211111309.A28392@visi.com>
- Reply-to: bartv at redhat dot com
>>>>> "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