Message-ID: <20051118090703.57135.qmail@domain.hid> Date: Fri, 18 Nov 2005 01:07:03 -0800 (PST) From: Cedric Herreman MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1696470112-1132304823=:56929" Content-Transfer-Encoding: 8bit Subject: [Xenomai-help] 2.6 kernel module with math functions List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org --0-1696470112-1132304823=:56929 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello, I am porting a 2.4 RTAI kernel module to Xenomai 2.0 kernel 2.6. I used some basic math functions in the original module. This is posing problems for me now. In the module source i include . I add -I/usr/include to the compiler flags and also "-ffast-math -mhard-float". If i compile this, i get warnings about double definitions of "__attribute_pure__" and "__attribute_used__". If i insert the kernel module, i get an error message : "Xenomai: Invalid use of FPU in Xenomai context at " + probably the address of the instruction where the math function is called. Can anyone give me a hint ? Thanks. This is the makefile : obj-m := rt_canio.o XENODIR = /usr/realtime KDIR := /lib/modules/2.6.13.3/build PWD := $(shell pwd) EXTRA_CFLAGS := -I$(XENODIR)/include -I/usr/include -ffast-math -mhard-float all: $(MAKE) -C $(KDIR) M=$(PWD) modules clean: $(MAKE) -C $(KDIR) M=$(PWD) clean --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. --0-1696470112-1132304823=:56929 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hello,

I am porting a 2.4 RTAI kernel module to Xenomai 2.0 kernel 2.6. I used some basic math functions in the original module. This is posing problems for me now.

In the module source i include <math.h>. I add -I/usr/include to the compiler flags and also "-ffast-math -mhard-float".

If i compile this, i get warnings about double definitions of "__attribute_pure__" and "__attribute_used__".

If i insert the kernel module, i get an error message :
"Xenomai: Invalid use of FPU in Xenomai context at " + probably the address of the instruction where the math function is called.

Can anyone give me a hint ? Thanks.

This is the makefile  :

obj-m    := rt_canio.o

XENODIR = /usr/realtime

KDIR    := /lib/modules/2.6.13.3/build
PWD    := $(shell pwd)

EXTRA_CFLAGS := -I$(XENODIR)/include -I/usr/include -ffast-math -mhard-float

all:
    $(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
    $(MAKE) -C $(KDIR) M=$(PWD) clean


Yahoo! FareChase - Search multiple travel sites in one click. --0-1696470112-1132304823=:56929--