Skip navigation.
Home
The QNX Community Portal

View topic - Changing Irq by using QNX setting?

Changing Irq by using QNX setting?

For the old QNX2 and QNX4 RTOS

Changing Irq by using QNX setting?

Postby flagship » Mon Aug 03, 2009 7:38 am

Hi,

I'm using ONX4. I have irq conflict problem. I wrote a simple code to change irq. It seems working. But I could not change Interrupt Pin No and we can not get interrupt from the pci after changing the irq.
I checked the irq change by using "pci -v". Is there an official way to change irq by using QNX OS settings or another way?
Thank you very much...
(Bios only can reserve irq but not change)
My code is
unsigned short deviceID,unsigned short vendorID,unsigned short indexOftheDevice,short interruptNo,short interruptPinNo;
int phdl=-1;
phdl = pci_attach (0)

unsigned pBusNumberpointer;
unsigned dev_funcx;

pci_find_device(deviceID,vendorID,indexOftheDevice,&pBusNumberpointer,&dev_funcx)
pci_map_irq(pBusNumberpointer,dev_funcx,interruptNo,interruptPinNo)
pci_detach (phdl);


I tried to change interrupt no 8 to 11 and interrupt pin no 0x0a to 0x0b
before Irq change, pci -v result is;
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 8
CPU Interrupt = 8h

After change, pci -v result is;
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 11
CPU Interrupt = bh
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

RE: Changing Irq by using QNX setting?

Postby mario » Mon Aug 03, 2009 1:02 pm

There is no standard method that I know of. It's too hardware depend and QNX4 doesn't provide any sort of abstraction layer and QNX4 relies on the BIOS handling these thing.

What do you mean by "conflict" PCI devices can share interrupt.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby flagship » Tue Aug 04, 2009 6:44 am

If I do not change the interrupt number, pc is halted after keyboard usage.
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Tue Aug 04, 2009 1:35 pm

What makes you thing its an interrupt problem? Is the keyboard USB?
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby flagship » Wed Aug 05, 2009 11:08 am

In fact, while debugging, connection is lost after interrupt came. And we need to reset the qnx.
Keyboard connection is ps2.

PCI device driver is our own. Maybe we made a mistake in driver.

Can PCI devices share interrupt? (are you sure)
Could you give me an advice to detect the error?

Thank you very much...
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Wed Aug 05, 2009 3:32 pm

flagship wrote:In fact, while debugging, connection is lost after interrupt came. And we need to reset the qnx.
Keyboard connection is ps2.

PCI device driver is our own. Maybe we made a mistake in driver.

[/quote]

You driver must assume that the interrupt is not intended for the hardware it's handling.

flagship wrote:Can PCI devices share interrupt? (are you sure)


100% sure.

flagship wrote:Could you give me an advice to detect the error?

Thank you very much...


Check with sin ir what program is using what interrupt, post results here.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby flagship » Thu Aug 06, 2009 2:53 am

I couldn't see "ir" option in "sin". It may be "sin -th" ?
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Thu Aug 06, 2009 3:30 am

no it`s "sin ir" try it
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby flagship » Thu Aug 06, 2009 8:57 am

Hi, I think I made mistake :cry: . I'm using QNX6.4.
I added the output "sin ir" which is same as "sin".
Thanks for your concern.
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Thu Aug 06, 2009 11:50 am

Yes you are in a QNX4 forum. Try pidin ir instead. Does the PC crash only when you use the keyboard AND start your application? If so can you post the code for your ISR?
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby flagship » Thu Aug 06, 2009 12:07 pm

I think this is not about keyboard. TCPIP connection is lost.
I added an attachment for "pidin ir".
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Thu Aug 06, 2009 1:02 pm

There is no attachement. You also did not mention if the crash only occurred when your program is running.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Postby flagship » Thu Aug 06, 2009 1:57 pm

sorry...
PC is only crashed when our program got an interrupt from driver.
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby flagship » Thu Aug 06, 2009 2:00 pm

pin_ir
pid tid name
1 1 /procnto-smp-instr
0 0x80000000 0 --- @0xf0054df0:0x0
1 0 0 -P- @0xf0052620:0x0
1 2 /procnto-smp-instr
1 3 /procnto-smp-instr
1 5 /procnto-smp-instr
1 7 /procnto-smp-instr
1 8 /procnto-smp-instr
1 10 /procnto-smp-instr
1 11 /procnto-smp-instr
1 12 /procnto-smp-instr
1 13 /procnto-smp-instr
1 14 /procnto-smp-instr
1 15 /procnto-smp-instr
2 1 sbin/tinit
4099 1 proc/boot/pci-bios
4100 1 proc/boot/slogger
4101 1 proc/boot/io-usb
2 0x9 0 TP- =PULSE 0x40000005:21 0:0
3 0xb 0 TP- =PULSE 0x40000008:21 0:0
4 0x9 0 TP- =PULSE 0x4000000b:21 0:0
5 0x9 0 TP- =PULSE 0x4000000e:21 0:0
6 0x9 0 TP- =PULSE 0x40000011:21 0:0
4101 2 proc/boot/io-usb
4101 3 proc/boot/io-usb
4101 4 proc/boot/io-usb
4101 5 proc/boot/io-usb
4101 6 proc/boot/io-usb
4101 7 proc/boot/io-usb
4101 8 proc/boot/io-usb
4101 9 proc/boot/io-usb
4101 10 proc/boot/io-usb
4102 1 proc/boot/io-hid
4102 2 proc/boot/io-hid
4102 3 proc/boot/io-hid
4102 4 proc/boot/io-hid
7 0x1 0 TP- @0xb820f30d:0xb8213820
4102 5 proc/boot/io-hid
4102 6 proc/boot/io-hid
4103 1 /boot/devc-con-hid
4103 2 /boot/devc-con-hid
8200 1 roc/boot/devb-eide
8200 2 roc/boot/devb-eide
8 0xe 0 TP- =PULSE 0x40000002:21 0x2:0
8200 3 roc/boot/devb-eide
9 0xf 0 TP- =PULSE 0x40000005:21 0x2:0
8200 4 roc/boot/devb-eide
8200 5 roc/boot/devb-eide
8200 6 roc/boot/devb-eide
8200 7 roc/boot/devb-eide
8200 10 roc/boot/devb-eide
8200 11 roc/boot/devb-eide
20489 1 sbin/pipe
20489 2 sbin/pipe
20489 3 sbin/pipe
20489 4 sbin/pipe
24586 1 sbin/mqueue
53259 1 usr/sbin/mcd
53259 2 usr/sbin/mcd
53259 3 usr/sbin/mcd
53259 4 usr/sbin/mcd
53259 5 usr/sbin/mcd
53259 6 usr/sbin/mcd
53259 7 usr/sbin/mcd
57356 1 usr/sbin/random
57356 2 usr/sbin/random
57356 3 usr/sbin/random
61453 1 sbin/enum-devices
77840 1 sbin/enum-usb
77840 2 sbin/enum-usb
94222 1 sbin/devc-ser8250
10 0x4 0 --- @0x804a654:0x8064098
11 0x3 0 --- @0x804a654:0x80640b0
12 0x5 0 --- @0x804a654:0x80640c8
13 0xa 0 --- @0x804a654:0x80640e0
94229 1 sbin/devc-par
94229 2 sbin/devc-par
94231 1 sbin/devc-serpci
14 0x9 0 --- @0x804ada0:0x8065098
94231 2 sbin/devc-serpci
98328 1 sbin/io-display
98328 2 sbin/io-display
98328 3 sbin/io-display
98328 4 sbin/io-display
98328 5 sbin/io-display
114713 1 sbin/io-pkt-v4-hc
114713 2 sbin/io-pkt-v4-hc
15 0 0 T-- @0x80b7a34:0x812baa0
16 0xb 0 TP- =PULSE 0x40000011:21 0x5a:0
17 0x9 0 TP- =PULSE 0x40000015:21 0x5a:0
114713 3 sbin/io-pkt-v4-hc
114713 4 sbin/io-pkt-v4-hc
176143 1 sbin/devc-pty
188433 1 usr/sbin/dumper
196626 1 r/sbin/dhcp.client
200724 1 usr/sbin/inetd
204819 1 usr/sbin/qconn
204819 2 usr/sbin/qconn
204819 3 usr/sbin/qconn
204819 4 usr/sbin/qconn
221206 1 bin/sh
221210 1 bin/login
221212 1 bin/login
221213 1 bin/login
282651 1 bin/pidin
flagship
Active Member
 
Posts: 10
Joined: Wed Mar 11, 2009 8:15 pm

Postby mario » Thu Aug 06, 2009 2:24 pm

As I also mentioned please post the code to your interrupt handler.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Next

Return to QNX2 and QNX4

Who is online

Users browsing this forum: No registered users and 1 guest