OpenQNX :: The QNX Community Portal

Aug 08, 2008 - 12:49 AM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 40 unlogged users and 0 registered users online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jacus
Post subject: Having two different interrput_id callouts in the same start  PostPosted: 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
 
 View user's profile Send private message  
Reply with quote Back to top
Dave Green
Post subject: Re: Having two different interrput_id callouts in the same s  PostPosted: Jan 31, 2007 - 05:16 PM
Guest





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
 
   
Reply with quote Back to top
jacus
Post subject: Re: Having two different interrput_id callouts in the same s  PostPosted: 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
 
 View user's profile Send private message  
Reply with quote Back to top
Brian Stecher
Post subject: Re: Having two different interrput_id callouts in the same s  PostPosted: Feb 01, 2007 - 01:47 PM
Guest





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
 
   
Reply with quote Back to top
jacus
Post subject: Re: Having two different interrput_id callouts in the same s  PostPosted: 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
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.