From 416954023b9814eb403a49e049660436a48f63d4 Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Sat, 4 Oct 2003 23:21:37 +0000 Subject: [PATCH] first pass at autoconf'd RT support done --- comedi/Makefile.am | 16 +++++++++------- comedi/drivers/Makefile.am | 12 +++++++++--- comedi/drivers/das16.c | 6 +++--- comedi/kcomedilib/Makefile.am | 2 +- m4/linux.m4 | 18 ++++++++++++++++-- 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/comedi/Makefile.am b/comedi/Makefile.am index f2cd368e..32390fd2 100644 --- a/comedi/Makefile.am +++ b/comedi/Makefile.am @@ -6,21 +6,23 @@ module_PROGRAMS = comedi.ko EXTRA_DIST = \ rt_pend_tq.h +if CONFIG_COMEDI_RT +RT_SOURCES = rt_pend_tq.c rt.c +else +RT_SOURCES = +endif + comedi_ko_SOURCES = \ comedi_fops.c \ proc.c \ range.c \ drivers.c \ - comedi_ksyms.c + comedi_ksyms.c \ + $(RT_SOURCES) -comedi_ko_CFLAGS = $(COMEDI_CFLAGS) $(LINUX_CFLAGS) +comedi_ko_CFLAGS = $(COMEDI_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) comedi_ko_LINK = $(top_builddir)/modtool --link -o $@ -#ifsel(CONFIG_COMEDI_RT) -# objlink(comedi.o rt_pend_tq.o rt.o) -#endif - - #comedi_ksyms.o: comedi_ksyms.c # $(CC) -o $@ comedi_ksyms.c $(CFLAGS) $(COMEDI_CFLAGS) $(LINUX_CFLAGS) -DEXPORT_SYMTAB diff --git a/comedi/drivers/Makefile.am b/comedi/drivers/Makefile.am index ccd924c2..ab729930 100644 --- a/comedi/drivers/Makefile.am +++ b/comedi/drivers/Makefile.am @@ -1,7 +1,7 @@ #SUBDIRS = addi-data -AM_CFLAGS = $(COMEDI_CFLAGS) $(LINUX_CFLAGS) +AM_CFLAGS = $(COMEDI_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) LINK = $(top_builddir)/modtool --link -o $@ EXTRA_DIST = \ @@ -23,7 +23,12 @@ EXTRA_DIST = \ rtd520.h # mpc8260cpm.ko -# comedi_rt_timer.ko + +if CONFIG_COMEDI_RT +rt_modules = comedi_rt_timer.ko +else +rt_modules = +endif if CONFIG_PCMCIA pcmcia_modules= \ @@ -103,7 +108,8 @@ module_PROGRAMS = 8255.ko \ skel.ko \ ssv_dnp.ko \ comedi_test.ko \ - $(pcmcia_modules) + $(pcmcia_modules) \ + $(rt_modules) 8255_ko_SOURCES = 8255.c adl_pci9111_ko_SOURCES = adl_pci9111.c diff --git a/comedi/drivers/das16.c b/comedi/drivers/das16.c index 671a118f..118dd2b4 100644 --- a/comedi/drivers/das16.c +++ b/comedi/drivers/das16.c @@ -721,7 +721,7 @@ struct das16_private_struct unsigned int ai_singleended; // single ended flag unsigned int clockbase; // master clock speed in ns volatile unsigned int control_state; // dma, interrupt and trigger control bits - volatile unsigned long adc_byte_count; // number of samples remaining + volatile unsigned long adc_byte_count; // number of bytes remaining unsigned int divisor1; // divisor dividing master clock to get conversion frequency unsigned int divisor2; // divisor dividing master clock to get conversion frequency unsigned int dma_chan; // dma channel @@ -734,8 +734,8 @@ struct das16_private_struct comedi_lrange *user_ao_range_table; struct timer_list timer; // for timed interrupt - volatile unsigned int timer_running : 1; - volatile unsigned int timer_mode : 1; // true if using timer mode + volatile short timer_running; + volatile short timer_mode; // true if using timer mode }; #define devpriv ((struct das16_private_struct *)(dev->private)) #define thisboard ((struct das16_board_struct *)(dev->board_ptr)) diff --git a/comedi/kcomedilib/Makefile.am b/comedi/kcomedilib/Makefile.am index 4238e6cf..7aeece01 100644 --- a/comedi/kcomedilib/Makefile.am +++ b/comedi/kcomedilib/Makefile.am @@ -2,7 +2,7 @@ module_PROGRAMS = kcomedilib.ko kcomedilib_ko_SOURCES = data.c ksyms.c dio.c kcomedilib_main.c get.c -kcomedilib_ko_CFLAGS = $(COMEDI_CFLAGS) $(LINUX_CFLAGS) +kcomedilib_ko_CFLAGS = $(COMEDI_CFLAGS) $(LINUX_CFLAGS) $(RTAI_CFLAGS) $(RTLINUX_CFLAGS) kcomedilib_ko_LINK = $(top_builddir)/modtool --link -o $@ #ksyms.o: ksyms.c diff --git a/m4/linux.m4 b/m4/linux.m4 index 6ce63d71..4d9e3cfc 100644 --- a/m4/linux.m4 +++ b/m4/linux.m4 @@ -84,8 +84,7 @@ the kernel source directory.]) ;; esac - DS_RTAI() - DS_RTLINUX() + DS_RT() ]) AC_DEFUN(DS_LINUX_2_6, @@ -252,8 +251,11 @@ AC_DEFUN(DS_RTAI, AC_MSG_ERROR([incorrect RTAI directory?]) fi fi + $1 AC_MSG_RESULT([found]) AC_DEFINE([CONFIG_COMEDI_RTAI],[true],[Define if kernel is RTAI patched]) + else + $2 fi AC_SUBST(RTAI_CFLAGS) @@ -278,7 +280,19 @@ AC_DEFUN(DS_RTLINUX, fi AC_MSG_RESULT([found]) AC_DEFINE([CONFIG_COMEDI_RTL],[true],[Define if kernel is RTLinux patched]) + $1 + else + $2 fi AC_SUBST(RTLINUX_CFLAGS) ]) +AC_DEFUN(DS_RT, +[ + DS_RTAI([USE_RTAI=yes],[USE_RTAI=no]) + DS_RTLINUX([USE_RTLINUX=yes],[USE_RTLINUX=no]) + AM_CONDITIONAL([CONFIG_COMEDI_RT],[test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes"]) + if test ${USE_RTAI} == "yes" -o ${USE_RTLINUX} == "yes" ; then + AC_DEFINE([CONFIG_COMEDI_RT],[true],[Define to enable comedi's RT support]) + fi +]) -- 2.26.2