 |
|
 |
| Author |
Message |
|
|
Post subject: Having two different interrput_id callouts in the same start
Posted: Jan 31, 2007 - 04:27 PM
|
|
Senior Member
Joined: Apr 22, 2003
Posts: 238
|
|
Hi,
I have two "interrupt_id" routines in my callout_interrupt.S file.
One is for a first board release while the second is for the latest
hardware version:
interrupt_id_ver16
interrupt_id_ver24
Also variable i.e. board_ver describes target release.
Now looking at the "board_ver" contents I would like
to do something like this:
if (board_ver == 16) then
interrupt_id_my_intr = interrupt_id_ver16;
else
interrupt_id_my_intr = interrupt_id_ver24;
and then pass interrupt_id_my_intr to the
intrs[] table:
const static struct startup_intrinfo intrs[] = {
....
{ 103, 20, 9, 0, 0, 0,
{ 0, 0, &interrupt_id_my_intr},
{ INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_my_intr},
&interrupt_mask_my_intr,
&interrupt_unmask_my_intr,
0,
},
....
Is it possible ? How can I pass particular interrupt_id
callout to the same startup_intrinfo structure ?
Regards,
Jacek |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: Having two different interrput_id callouts in the same s
Posted: Jan 31, 2007 - 05:16 PM
|
|
|
|
Jacek,
you could do something like this, in your init_intrinfo.c:
const static struct startup_intrinfo intrs_ver16[] = {
{ base, num, cascade,
0, 0, 0,
{0, 0, &interrupt_id_ver16},
{INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_both_vers},
&interrupt_mask_both_vers, &interrupt_unmask_both_vers, 0, 0,
},
};
const static struct startup_intrinfo intrs_ver24[] = {
{ base, num, cascade,
0, 0, 0,
{0, 0, &interrupt_id_ver24},
{INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_both_vers},
&interrupt_mask_both_vers, &interrupt_unmask_both_vers, 0, 0,
},
};
void init_intrinfo() {
if(board_ver == 16)
add_interrupt_array(intrs_ver16, sizeof(intrs_ver16));
else
add_interrupt_array(intrs_ver24, sizeof(intrs_ver24));
}
Jacek Rudnicki <jacek.rudnicki@quantum.com.pl> wrote:
Quote:
Hi,
I have two "interrupt_id" routines in my callout_interrupt.S file.
One is for a first board release while the second is for the latest
hardware version:
interrupt_id_ver16
interrupt_id_ver24
Also variable i.e. board_ver describes target release.
Now looking at the "board_ver" contents I would like
to do something like this:
if (board_ver == 16) then
interrupt_id_my_intr = interrupt_id_ver16;
else
interrupt_id_my_intr = interrupt_id_ver24;
and then pass interrupt_id_my_intr to the
intrs[] table:
const static struct startup_intrinfo intrs[] = {
...
{ 103, 20, 9, 0, 0, 0,
{ 0, 0, &interrupt_id_my_intr},
{ INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_my_intr},
&interrupt_mask_my_intr,
&interrupt_unmask_my_intr,
0,
},
...
Is it possible ? How can I pass particular interrupt_id
callout to the same startup_intrinfo structure ?
Regards,
Jacek
--
David Green (dgreen@qnx.com)
QNX Software Systems Ltd.
http://www.qnx.com |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: Having two different interrput_id callouts in the same s
Posted: Feb 01, 2007 - 08:34 AM
|
|
Senior Member
Joined: Apr 22, 2003
Posts: 238
|
|
Hi Dave,
It works!
Can I call "add_interrupt_array ()" in my init_intrinfo.c twice ?
void init_intrinfo() {
....
add_interrupt_array (common_intrs, sizeof(common_intrs));
if(board_ver == 16)
add_interrupt_array(intrs_ver16, sizeof(intrs_ver16));
else
add_interrupt_array(intrs_ver24, sizeof(intrs_ver24));
}
Will this work ?
Regards,
Jacek
Użytkownik "Dave Green" <dgreen@dgreen.qnx.com> napisał w wiadomości
news:epqitn$g3e$1@inn.qnx.com...
Quote:
Jacek,
you could do something like this, in your init_intrinfo.c:
const static struct startup_intrinfo intrs_ver16[] = {
{ base, num, cascade,
0, 0, 0,
{0, 0, &interrupt_id_ver16},
{INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_both_vers},
&interrupt_mask_both_vers, &interrupt_unmask_both_vers, 0, 0,
},
};
const static struct startup_intrinfo intrs_ver24[] = {
{ base, num, cascade,
0, 0, 0,
{0, 0, &interrupt_id_ver24},
{INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_both_vers},
&interrupt_mask_both_vers, &interrupt_unmask_both_vers, 0, 0,
},
};
void init_intrinfo() {
if(board_ver == 16)
add_interrupt_array(intrs_ver16, sizeof(intrs_ver16));
else
add_interrupt_array(intrs_ver24, sizeof(intrs_ver24));
}
Jacek Rudnicki <jacek.rudnicki@quantum.com.pl> wrote:
Hi,
I have two "interrupt_id" routines in my callout_interrupt.S file.
One is for a first board release while the second is for the latest
hardware version:
interrupt_id_ver16
interrupt_id_ver24
Also variable i.e. board_ver describes target release.
Now looking at the "board_ver" contents I would like
to do something like this:
if (board_ver == 16) then
interrupt_id_my_intr = interrupt_id_ver16;
else
interrupt_id_my_intr = interrupt_id_ver24;
and then pass interrupt_id_my_intr to the
intrs[] table:
const static struct startup_intrinfo intrs[] = {
...
{ 103, 20, 9, 0, 0, 0,
{ 0, 0, &interrupt_id_my_intr},
{ INTR_GENFLAG_LOAD_INTRMASK, 0, &interrupt_eoi_my_intr},
&interrupt_mask_my_intr,
&interrupt_unmask_my_intr,
0,
},
...
Is it possible ? How can I pass particular interrupt_id
callout to the same startup_intrinfo structure ?
Regards,
Jacek
--
David Green (dgreen@qnx.com)
QNX Software Systems Ltd.
http://www.qnx.com
|
|
|
| |
|
|
|
 |
|
|
Post subject: Re: Having two different interrput_id callouts in the same s
Posted: Feb 01, 2007 - 01:47 PM
|
|
|
|
In article <eps8ke$kha$1@inn.qnx.com>,
Jacek Rudnicki <jacek.rudnicki@quantum.com.pl> wrote:
Quote:
Can I call "add_interrupt_array ()" in my init_intrinfo.c twice ?
void init_intrinfo() {
...
add_interrupt_array (common_intrs, sizeof(common_intrs));
if(board_ver == 16)
add_interrupt_array(intrs_ver16, sizeof(intrs_ver16));
else
add_interrupt_array(intrs_ver24, sizeof(intrs_ver24));
}
Yes, you can call add_interrupt_array() as many times as you want.
If you only have one struct startup_intrinfo to add, you can be a little more
efficient and just use the add_interrupt() function (add_interrupt_array()
just calls add_interrupt() for all the array elements).
--
Brian Stecher (bstecher@qnx.com) QNX Software Systems
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8 |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: Having two different interrput_id callouts in the same s
Posted: Feb 01, 2007 - 03:02 PM
|
|
Senior Member
Joined: Apr 22, 2003
Posts: 238
|
|
|
Quote:
Can I call "add_interrupt_array ()" in my init_intrinfo.c twice ?
void init_intrinfo() {
...
add_interrupt_array (common_intrs, sizeof(common_intrs));
if(board_ver == 16)
add_interrupt_array(intrs_ver16, sizeof(intrs_ver16));
else
add_interrupt_array(intrs_ver24, sizeof(intrs_ver24));
}
Yes, you can call add_interrupt_array() as many times as you want.
If you only have one struct startup_intrinfo to add, you can be a little
more
efficient and just use the add_interrupt() function (add_interrupt_array()
just calls add_interrupt() for all the array elements).
I call add_interrupt_array() twice as in above example.
Unfortunately OS doesn't boot at all. It hangs probably in the
init_intrinfo() function. I will check this ...
Jacek |
|
|
| |
|
|
|
 |
|
|
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group Credits |
|
|
|
 |