This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stepping in Arm swi call


>>>>> Pierre Habraken writes:

> This is a multi-part message in MIME format.
> --------------D9F63B75DAA60D3922886892
> Content-Type: text/plain; charset=iso-8859-1
> Content-Transfer-Encoding: 8bit

> The patch below adds support for stepping in swi calls. I tested it on
> an Arm E7T board (I've not tested it against Thumb execution mode
> though...).

> Pierre
> -- 
> ________________________________________________________________________
> Pierre HABRAKEN - mailto:Pierre.Habraken@imag.fr
> Tél: 04 76 82 72 83 - Fax: 04 76 82 72 87
> IMAG-LSR BP72 38402 SAINT MARTIN D'HERES Cedex
> ________________________________________________________________________
> --------------D9F63B75DAA60D3922886892
> Content-Type: text/plain; charset=us-ascii;
>  name="stepin_swi.patch"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="stepin_swi.patch"

> --- hal/arm/arch/current/src/arm_stub.c.inst	Tue Nov 12 22:50:38 2002
> +++ hal/arm/arch/current/src/arm_stub.c	Tue May  6 10:14:44 2003
> @@ -528,7 +528,12 @@
>              }
>          }
>      case 0x3:  // Coprocessor & SWI
> -        return (pc+1);
> +        if (((ins & 0x03000000) == 0x03000000) && ins_will_execute(ins)) {
> +           // SWI
> +           return (CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT * 4);
> +        } else {
> +           return (pc+1);
> +        }
>      default:
>          // Never reached - but fixes compiler warning.
>          return 0;
> @@ -570,10 +575,15 @@
>          }
>          break;
>      case 0xd:
> -        // Bcc
> +        // Bcc | SWI
>          // Use ARM function to check condition
>          arm_ins = ((unsigned long)(ins & 0x0f00)) << 20;
> -        if (ins_will_execute(arm_ins)) {
> +        if ((arm_ins & 0xF0000000) == 0xF0000000) {
> +            // SWI
> +            new_pc =
> +              MAKE_THUMB_ADDR(CYGNUM_HAL_VECTOR_SOFTWARE_INTERRUPT * 4);
                 ^^^^^^^^^^^^^^^
You don't need that. The SWI switches the cpu back to normal ARM mode.

--Mark



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]