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
mario
August 3, 2009, 1:02pm
2
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.
If I do not change the interrupt number, pc is halted after keyboard usage.
mario
August 4, 2009, 1:35pm
4
What makes you thing its an interrupt problem? Is the keyboard USB?
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…
mario
August 5, 2009, 3:32pm
6
flagship:
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.
100% sure.
Check with sin ir what program is using what interrupt, post results here.
I couldn’t see “ir” option in “sin”. It may be “sin -th” ?
Hi, I think I made mistake . I’m using QNX6.4.
I added the output “sin ir” which is same as “sin”.
Thanks for your concern.
mario
August 6, 2009, 11:50am
10
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?
I think this is not about keyboard. TCPIP connection is lost.
I added an attachment for “pidin ir”.
mario
August 6, 2009, 1:02pm
12
There is no attachement. You also did not mention if the crash only occurred when your program is running.
sorry…
PC is only crashed when our program got an interrupt from driver.
mario
August 6, 2009, 2:24pm
15
As I also mentioned please post the code to your interrupt handler.
This code works fine with one pci serial card on computer.
memset( &isrEvent, 0, sizeof( isrEvent));
SIGEV_INTR_INIT (&isrEvent);
m_id = InterruptAttachEvent(m_irqNumber[m_boardNumber], &isrEvent, _NTO_INTR_FLAGS_END | _NTO_INTR_FLAGS_TRK_MSK);
int waitEvent() {
uint8_t myISR;
currentEvent = 0;
while (currentEvent == 0)
{
InterruptWait (0, NULL);
myISR = registerRead(REG_ISR) & 0x3F ;
switch(myISR)
{
case 0x04:
// Level 2a
currentEvent = RX_DATA_AVAILABLE;
break;
case 0x02:
// Level 3
currentEvent = TRANSMITTER_EMPTY;
break;
default:
break;
}
InterruptUnmask (m_irqNumber[m_boardNumber], m_id);
pthread_testcancel();
}
return currentEvent;
mario
August 7, 2009, 12:57pm
17
Your code doesn’t CLEAR the cause of the interrupt. Where do you get m_boardNumber from? For efficiency you should loop until there are no more interrupt coming from the interrupt.
There is another function is used to enable the interrupts which is done by writing register.
initialize
unsigned int boardNumber;
ThreadCtl(_NTO_TCTL_IO,0);
itsPCISerial->getAddress();
if(itsPCISerial->boardCount <= 0)
return 0;
else
{
for (boardNumber = 0 ; boardNumber < itsPCISerial->boardCount ; boardNumber++)
{
itsPCISerial->initializeBregBase(boardNumber);
m_irqNumber[boardNumber] = itsPCISerial->boardIrq[boardNumber];
}
return itsPCISerial->boardCount;
}
open
m_boardNumber = boardNumber;
m_portNumber = portNumber;
if (m_portNumber == 0)
m_portOffset = 0x00;
else if (m_portNumber == 1)
m_portOffset = 0x08;
else
return -1;
itsPCISerial->openPort(portSettings, m_boardNumber, m_portNumber, m_portOffset);
memset( &isrEvent, 0, sizeof( isrEvent));
SIGEV_INTR_INIT (&isrEvent);
m_id = InterruptAttachEvent(m_irqNumber[m_boardNumber], &isrEvent, _NTO_INTR_FLAGS_END | _NTO_INTR_FLAGS_TRK_MSK);
wait event
int waitEvent() {
uint8_t myISR;
currentEvent = 0;
while (currentEvent == 0)
{
InterruptWait (0, NULL);
myISR = registerRead(REG_ISR) & 0x3F ;
switch(myISR)
{
case 0x04:
// Level 2a
currentEvent = RX_DATA_AVAILABLE;
break;
case 0x02:
// Level 3
currentEvent = TRANSMITTER_EMPTY;
break;
default:
break;
}
InterruptUnmask (m_irqNumber[m_boardNumber], m_id);
pthread_testcancel();
mario
August 8, 2009, 5:13pm
19
Please re-read my previous post.
rose78
October 8, 2009, 11:02am
20
Hello, I need to know how to change Hardware IRQ’s i got my brothers computer with 6 Devices on IRQ 7. how do i fix this?
thanks.
642-845 questions | 642-825 questions | 642-812 questions