This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: Stepping in Arm swi call
- From: Mark Salter <msalter at redhat dot com>
- To: Pierre dot Habraken at imag dot fr
- Cc: ecos-patches at sources dot redhat dot com
- Date: Tue, 6 May 2003 07:37:44 -0400 (EDT)
- Subject: Re: Stepping in Arm swi call
- References: <3EB7734D.11DA9D9E@imag.fr>
>>>>> 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