* [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* Re: [Xenomai-help] Problem to compile rtdm module
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
1 sibling, 0 replies; 5+ messages in thread
From: Gilles Chanteperdrix @ 2007-06-27 14:40 UTC (permalink / raw)
To: Perrine Martignoni; +Cc: xenomai-help
> 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 ...
See:
http://lwn.net/Kernel/LDD3/
Chapter 2.
--
Gilles Chanteperdrix
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-help] Problem to compile rtdm module
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
1 sibling, 2 replies; 5+ messages in thread
From: Jan Kiszka @ 2007-06-27 14:46 UTC (permalink / raw)
To: Perrine Martignoni; +Cc: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 3748 bytes --]
Perrine Martignoni wrote:
> 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 ...
Have you seen this version of "hearbeat" already?
http://svn.gna.org/viewcvs/xenomai/trunk/examples/rtdm/driver-api/
It's now prepared to handle more than just x86 keyboards. Maybe you want
to put your LED show into this framework as well.
You can build it with the provided Makefile, calling "make
KSRC=<kernel-srcdir> XENO=<xenomai-userland-instdir> CROSS_COMPILE=..
ARCH=...".
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-help] Problem to compile rtdm module
2007-06-27 14:46 ` Jan Kiszka
@ 2007-06-28 15:00 ` Perrine Martignoni
2007-10-17 14:48 ` Perrine Martignoni
1 sibling, 0 replies; 5+ messages in thread
From: Perrine Martignoni @ 2007-06-28 15:00 UTC (permalink / raw)
To: xenomai-help
[-- Attachment #1: Type: text/plain, Size: 3954 bytes --]
Thanks, I tried to compile my module fine and it works.
On 6/27/07, Jan Kiszka <jan.kiszka@domain.hid> wrote:
>
> Perrine Martignoni wrote:
> > 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 ...
>
> Have you seen this version of "hearbeat" already?
>
> http://svn.gna.org/viewcvs/xenomai/trunk/examples/rtdm/driver-api/
>
> It's now prepared to handle more than just x86 keyboards. Maybe you want
> to put your LED show into this framework as well.
>
> You can build it with the provided Makefile, calling "make
> KSRC=<kernel-srcdir> XENO=<xenomai-userland-instdir> CROSS_COMPILE=..
> ARCH=...".
>
> Jan
>
>
>
[-- Attachment #2: Type: text/html, Size: 5056 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-help] Problem to compile rtdm module
2007-06-27 14:46 ` Jan Kiszka
2007-06-28 15:00 ` Perrine Martignoni
@ 2007-10-17 14:48 ` Perrine Martignoni
1 sibling, 0 replies; 5+ messages in thread
From: Perrine Martignoni @ 2007-10-17 14:48 UTC (permalink / raw)
To: Jan Kiszka, xenomai-help
[-- Attachment #1: Type: text/plain, Size: 4201 bytes --]
Hello,
I have a question about the Makefile you advise to me.
I used this Makefile until now to compile my RTDM module.
And I want to know how to compile my module and application in the Makefile
directory, not in the source directory.
My Makefile and the sources are in different directories.
Thanks
On 6/27/07, Jan Kiszka <jan.kiszka@domain.hid> wrote:
>
> Perrine Martignoni wrote:
> > 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 ...
>
> Have you seen this version of "hearbeat" already?
>
> http://svn.gna.org/viewcvs/xenomai/trunk/examples/rtdm/driver-api/
>
> It's now prepared to handle more than just x86 keyboards. Maybe you want
> to put your LED show into this framework as well.
>
> You can build it with the provided Makefile, calling "make
> KSRC=<kernel-srcdir> XENO=<xenomai-userland-instdir> CROSS_COMPILE=..
> ARCH=...".
>
> Jan
>
>
>
[-- Attachment #2: Type: text/html, Size: 5340 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.