From: Bart Jonkers <jonkersbart@domain.hid>
To: xenomai@xenomai.org
Subject: [Xenomai-help] testing interrupt latency
Date: Thu, 03 Aug 2006 16:30:59 +0200 [thread overview]
Message-ID: <1154615459.9835.62.camel@domain.hid> (raw)
Hey,
I have written a small module to test the interrupt response time of
Xenomai to compare it with the time of Linux.
I generate an interrupt on a GPIO pin and toggles another GPIO pin in
the interrupt service routine. (code below)
The time between the generated interrupt and the value change on the
GPIO pin is taken as interrupt response time.
Everything works well, but I notice a strange behavior.
I thought that the interrupt response time of xenomai should be (as good
as) constant all the time. But I see that this is not the case.
Did I do something wrong in my code or did I made a wrong assumption?
Thanks, Bart
#include <linux/init.h>
#include <linux/module.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/xsilo.h>
#include <native/intr.h>
#include <native/timer.h>
MODULE_LICENSE("Dual BSD/GPL");
RT_INTR intr_desc_but;
static int xsilo_irq_measure_irq_handler_but(struct xnintr *intr)
{
/* Make GPIO pin low */
GPCR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
/* Wait 50µs */
rt_timer_spin(50000);
/* Make GPIO pin high */
GPSR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
return RT_INTR_HANDLED;
}
static int __init xsilo_irq_measure_init(void)
{
int retval;
/* initialize output GPIO pin */
GPSR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
GPDR(XSILO_JOYSTICK_UP_GPIO) |= GPIO_bit(XSILO_JOYSTICK_UP_GPIO);
/* initialize interrupt and the receiving GPIO pin */
retval = rt_intr_create(&intr_desc_but,"RT_measure_irq_but",
XSILO_MENU_IRQ,xsilo_irq_measure_irq_handler_but,NULL,I_EDGE);
if (!retval){
GPDR(XSILO_MENU_GPIO) |= GPIO_bit(XSILO_MENU_GPIO);
set_irq_type(XSILO_MENU_IRQ, IRQT_RISING);
rt_intr_enable(&intr_desc_but);
}
return 0;
}
static void __exit xsilo_irq_measure_exit(void)
{
rt_intr_delete(&intr_desc_but);
}
module_init(xsilo_irq_measure_init);
module_exit(xsilo_irq_measure_exit);
next reply other threads:[~2006-08-03 14:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-03 14:30 Bart Jonkers [this message]
2006-08-03 18:00 ` [Xenomai-help] testing interrupt latency Gilles Chanteperdrix
2006-08-03 18:18 ` Philippe Gerum
2006-08-04 6:26 ` Jan Kiszka
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=1154615459.9835.62.camel@domain.hid \
--to=jonkersbart@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.