All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Problem to compile rtdm module
@ 2007-06-27 14:27 Perrine Martignoni
  2007-06-27 14:40 ` Gilles Chanteperdrix
  2007-06-27 14:46 ` Jan Kiszka
  0 siblings, 2 replies; 5+ messages in thread
From: Perrine Martignoni @ 2007-06-27 14:27 UTC (permalink / raw)
  To: xenomai-help

[-- Attachment #1: Type: text/plain, Size: 2964 bytes --]

Hello,

Currently, I use xenomai 2.3.1 on an ARM9.
I try to cross compile a module for my kernel and I don't find the right way
to do it, I guess.

Here is the code (it's to put the led off and on) :

#include <rtdm/rtdm_driver.h>
MODULE_LICENSE("GPL");

rtdm_task_t heartbeat_task;
int         end = 0;

#define HEARTBEAT_PERIOD    100000000   /* 100 ms */
void heartbeat(void *cookie)
{
 int state = 0;
 int led_state[] = { 0, 1 };
 while (!end) {
  rtdm_task_wait_period();

  at91_set_gpio_value(AT91_PIN_PB2,led_state[state++]);

  if (state > 1)
   state = 0;
 }
}

int init_module(void)
{

leds_init();
return rtdm_task_init(&heartbeat_task, "heartbeat", heartbeat, NULL,99,
HEARTBEAT_PERIOD);
}

void cleanup_module(void)
{
 end = 1;
 rtdm_task_join_nrt(&heartbeat_task, 100);
 at91_led_off(AT91_PIN_PB2);
}

And here is my Makefile :

CFLAGS = -g -D__KERNEL__ -DMODULE -I/usr/xenomai_arm-2.3.1uClibc/include

LDFLAGS = -D__KERNEL__ -DMODULE

test:test_leds.o

ld -r -o test.ko -L/usr/xenomai_arm-2.3.1uClibc/lib -lnative -lrtdm
test_leds.o

test_leds.o:test_leds.c

arm-linux-gcc $(CFLAGS) -c test_leds.c


When I compile, I have a lot of errors whose the begin is :


In file included from
/usr/src/ELDK_arm/usr/../arm/usr/include/linux/capability.h:45,

from /usr/src/ELDK_arm/usr/../arm/usr/include/linux/sched.h:46,

from /usr/src/ELDK_arm/usr/../arm/usr/include/linux/ptrace.h:81,

from /usr/xenomai_arm-2.3.1uClibc/include/asm/system.h:28,

from /usr/src/ELDK_arm/usr/../arm/usr/include/asm/bitops.h:23,

from /usr/src/ELDK_arm/usr/../arm/usr/include/linux/bitops.h:9,

from /usr/xenomai_arm-2.3.1uClibc/include/asm/atomic.h:29,

from /usr/xenomai_arm-2.3.1uClibc/include/rtdm/rtdm_driver.h:33,

from test_leds.c:21:

/usr/src/ELDK_arm/usr/../arm/usr/include/linux/spinlock.h:280: error: parse
error before '*' token

In file included from
/usr/src/ELDK_arm/usr/../arm/usr/include/linux/jiffies.h:4,

from /usr/src/ELDK_arm/usr/../arm/usr/include/linux/sched.h:51,

from /usr/src/ELDK_arm/usr/../arm/usr/include/linux/ptrace.h:81,

from /usr/xenomai_arm-2.3.1uClibc/include/asm/system.h:28,

from /usr/src/ELDK_arm/usr/../arm/usr/include/asm/bitops.h:23,

from /usr/src/ELDK_arm/usr/../arm/usr/include/linux/bitops.h:9,

from /usr/xenomai_arm-2.3.1uClibc/include/asm/atomic.h:29,

from /usr/xenomai_arm-2.3.1uClibc/include/rtdm/rtdm_driver.h:33,

from test_leds.c:21:

/usr/src/ELDK_arm/usr/../arm/usr/include/linux/calc64.h: In function
'do_div_llr':

/usr/src/ELDK_arm/usr/../arm/usr/include/linux/calc64.h:25: error: parse
error before '__asmeq'

In file included from
/usr/src/ELDK_arm/usr/../arm/usr/include/linux/sched.h:51,

from /usr/src/ELDK_arm/usr/../arm/usr/include/linux/ptrace.h:81,

from /usr/xenomai_arm-2.3.1uClibc/include/asm/system.h:28,

from /usr/src/ELDK_arm/usr/../arm/usr/include/asm/bitops.h:23,



I think it's a problem of option in the Makefile but I don't see. It's the
first time I do a module for Linux so ...

thanks

[-- Attachment #2: Type: text/html, Size: 5473 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-17 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-27 14:27 [Xenomai-help] Problem to compile rtdm module Perrine Martignoni
2007-06-27 14:40 ` Gilles Chanteperdrix
2007-06-27 14:46 ` Jan Kiszka
2007-06-28 15:00   ` Perrine Martignoni
2007-10-17 14:48   ` Perrine Martignoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.