All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Zhenghui <ferretliu@domain.hid>
To: xenomai <xenomai@xenomai.org>
Subject: [Xenomai-help] Different performance in irq handling between native skin and rtdm?
Date: Sat, 15 Jul 2006 13:28:54 +0800	[thread overview]
Message-ID: <44B87D16.7030407@domain.hid> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have an A/D card which has a shared irq number 16 with the Radeon 7500
video card. So I have to in isr tell whether this interrupt is from AD
card. If not, then let other isr handle it. For native skin, this is
done by returning RT_INTR_PROPAGATE in isr, while for rtdm, by using
RTDM_IRQTYPE_SHARED flag when request the interrupt. I found both works,
but rtdm solution make the xorg very slow (open a new window, animation
etc.), while native skin not. It seems that it take a much longer
latency for rtdm to propagate the irq to video card than for native
skin. How did this happen?

My xenomai version is 2.1.0, linux kernel is 2.6.15.7

* The simplest codes for native skin is like following:

  RT_INTR AD_intr;

  err=rt_intr_create(&AD_intr, "ADISR", 16, AD_ISR, NULL, 0);

  err=rt_intr_enable(&AD_intr);

And in the cleanup function:

  rt_intr_delete(&AD_intr);

And the ISR:

  int AD_ISR(struct xnintr *intr)
  {
	if(AD_IS_IRQ){  //A macro to know whether it's an AD card IRQ
        	
		//do some thing

		//the returned value tell RTAI IRQ is done
		return (RT_INTR_HANDLED);
	}
	else{
		//this IRQ is not AD card IRQ
		//the returned value let linux to handle such IRQ
		return (RT_INTR_NONE | RT_INTR_PROPAGATE);
	}
  }


* The simplest codes for rtdm is like following:

  rtdm_irq_t AD_intr;

  err = rtdm_irq_request(&AD_intr, 16, AD_ISR, RTDM_IRQTYPE_SHARED, 		
			  ADISR", NULL);

  err = rtdm_irq_enable(&AD_intr);

And in the cleanup function:

  rtdm_irq_free(&AD_intr);

And the ISR:

  static int AD_ISR(rtdm_irq_t *irq_handle)
  {
	if(AD_IS_IRQ){  //A macro to know whether it's an AD card IRQ
        	
		//do some thing

		//the returned value tell RTAI IRQ is done
		return (RTDM_IRQ_HANDLED);
	}
	else{
		//this IRQ is not AD card IRQ
		//the returned value let linux to handle such IRQ
		return (RTDM_IRQ_NONE);
	}

  }


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEuH0WGufRPjRB9aARAiE5AJ4j56xRJo1tIhm4+eMJFGWDNiBCkgCfTHJs
YWccJyqmlTYKFFRZQJAuDzQ=
=ZuqS
-----END PGP SIGNATURE-----


             reply	other threads:[~2006-07-15  5:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-15  5:28 Liu Zhenghui [this message]
2006-07-15  8:32 ` [Xenomai-help] Different performance in irq handling between native skin and rtdm? 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=44B87D16.7030407@domain.hid \
    --to=ferretliu@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.