From: Jan Kiszka <jan.kiszka@domain.hid>
To: Perrine Martignoni <perrmart@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Problem to compile rtdm module
Date: Wed, 27 Jun 2007 16:46:27 +0200 [thread overview]
Message-ID: <46827843.8000405@domain.hid> (raw)
In-Reply-To: <7289437c0706270727m41d21637tc3030ae2c4f6cf06@domain.hid>
[-- 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 --]
next prev parent reply other threads:[~2007-06-27 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2007-06-28 15:00 ` Perrine Martignoni
2007-10-17 14:48 ` Perrine Martignoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46827843.8000405@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=perrmart@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.