Skip navigation.
Home
The QNX Community Portal

View topic - Having two different interrput_id callouts in the same start

Having two different interrput_id callouts in the same start

Read-only archive of qnx.bsp (Discuss building an image, flashing a board or using a BSP) at inn.qnx.com

Having two different interrput_id callouts in the same start

Postby jacus » Wed Jan 31, 2007 4:27 pm

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
jacus
Senior Member
 
Posts: 239
Joined: Tue Apr 22, 2003 8:36 am

Re: Having two different interrput_id callouts in the same s

Postby Dave Green » Wed Jan 31, 2007 5: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:
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
Dave Green
 

Re: Having two different interrput_id callouts in the same s

Postby jacus » Thu Feb 01, 2007 8:34 am

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...
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
jacus
Senior Member
 
Posts: 239
Joined: Tue Apr 22, 2003 8:36 am

Re: Having two different interrput_id callouts in the same s

Postby Brian Stecher » Thu Feb 01, 2007 1:47 pm

In article <eps8ke$kha$1@inn.qnx.com>,
Jacek Rudnicki <jacek.rudnicki@quantum.com.pl> wrote:
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
Brian Stecher
 

Re: Having two different interrput_id callouts in the same s

Postby jacus » Thu Feb 01, 2007 3:02 pm

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
jacus
Senior Member
 
Posts: 239
Joined: Tue Apr 22, 2003 8:36 am


Return to qnx.bsp

Who is online

Users browsing this forum: No registered users and 1 guest