public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] arm_stub SWI compiler warning
@ 2004-09-19 13:20 Andrew Lunn
  2004-09-19 21:50 ` [ECOS] " Mark Salter
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Lunn @ 2004-09-19 13:20 UTC (permalink / raw)
  To: Mark Salter, eCos Disuss

Hi Mark

arm_stub.c is giving me a compiler warning. The line causing the problem is:

    case 0x3:  // Coprocessor & SWI
        if (((ins & 0x03000000) == 0x03000000) && ins_will_execute(ins)) {
           // SWI
->          return (CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT * 4);
        } else {
           return (pc+1);
        }

which is in function 
// Decide the next instruction to be executed for a given instruction
static unsigned long *
target_ins(unsigned long *pc, unsigned long ins)

This code does not look right to me. Shouldn't it be returning the
address in the software interrupt vector, where as its just returning
4x a constant, which is not an address at all.

        Thanks
                Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ECOS] Re: arm_stub SWI compiler warning
  2004-09-19 13:20 [ECOS] arm_stub SWI compiler warning Andrew Lunn
@ 2004-09-19 21:50 ` Mark Salter
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Salter @ 2004-09-19 21:50 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos Disuss

On Sun, 2004-09-19 at 09:20, Andrew Lunn wrote:
> Hi Mark
> 
> arm_stub.c is giving me a compiler warning. The line causing the problem is:
> 
>     case 0x3:  // Coprocessor & SWI
>         if (((ins & 0x03000000) == 0x03000000) && ins_will_execute(ins)) {
>            // SWI
> ->          return (CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT * 4);
>         } else {
>            return (pc+1);
>         }
> 
> which is in function 
> // Decide the next instruction to be executed for a given instruction
> static unsigned long *
> target_ins(unsigned long *pc, unsigned long ins)
> 
> This code does not look right to me. Shouldn't it be returning the
> address in the software interrupt vector, where as its just returning
> 4x a constant, which is not an address at all.
> 
It looks like the code is using CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT as
an offset into __exception_handlers and assumes __exception_handlers
is at address 0x0. That will usually work, but it might be better to
use the address contained in the actual vector. 
 
--Mark



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-09-19 21:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-19 13:20 [ECOS] arm_stub SWI compiler warning Andrew Lunn
2004-09-19 21:50 ` [ECOS] " Mark Salter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).