All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 657006] [NEW] arm - svc instruction
@ 2010-10-08 18:00 jb
  2010-10-08 19:48 ` [Qemu-devel] [Bug 657006] " jb
                   ` (17 more replies)
  0 siblings, 18 replies; 20+ messages in thread
From: jb @ 2010-10-08 18:00 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

The svc instruction doesn't work as expected.

-> qemu 0.13.0 rc1 (git)

Test : demo with freeRTOS (for example
FreeRTOS-6.0.5/Demo/CORTEX_LM3S811_GCC) with the card lm3s811evb.

If we start the scheduler, it will call that function (__attribute__ ((
naked ))) :

void vPortStartFirstTask( void )

{

        __asm volatile(

                                        " ldr r0, =0xE000ED08   \n" /*
Use the NVIC offset register to locate the stack. */

                                        " ldr r0, [r0]
\n"

                                        " ldr r0, [r0]
\n"

                                        " msr msp, r0
\n" /* Set the msp back to the start of the stack. */

                                        " svc 0
\n" /* System call to start first task. */

                                );

}

The 4 first lines in asm work fine. The scv 0 call will rise the right interrupt in qemu (line 151, in arm_gic.c, best_irq = 15). However, it will never call the PendSV Handler (xPortPendSVHandler here). This function is recorded in the nvic vector.
Next, (after the svc), the processor will execute the line after in code (this is a naked function) so the next function written after vPortStartFirstTask in the code.


command line :
console 1 : qemu-system-arm -M lm3s6965evb -kernel gcc/RTOSDemo.axf -s -S
console 2 : arm-none-eabi-gdb -ex "target remote localhost:1234" gcc/RTOSDemo.axf

arm-none-eabi from http://www.codesourcery.com/sgpp/lite/arm/portal/release1294
Same error with another project with arm-elf

processor : arm cortex m3

host : gentoo (2.6.35-r9) (without kqemu)

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
arm - svc instruction
https://bugs.launchpad.net/bugs/657006
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

Status in QEMU: New

Bug description:
The svc instruction doesn't work as expected.

-> qemu 0.13.0 rc1 (git)

Test : demo with freeRTOS (for example FreeRTOS-6.0.5/Demo/CORTEX_LM3S811_GCC) with the card lm3s811evb.

If we start the scheduler, it will call that function (__attribute__ (( naked ))) :

void vPortStartFirstTask( void )

{

	__asm volatile(

					" ldr r0, =0xE000ED08 	\n" /* Use the NVIC offset register to locate the stack. */

					" ldr r0, [r0] 			\n"

					" ldr r0, [r0] 			\n"

					" msr msp, r0			\n" /* Set the msp back to the start of the stack. */

					" svc 0					\n" /* System call to start first task. */

				);

}

The 4 first lines in asm work fine. The scv 0 call will rise the right interrupt in qemu (line 151, in arm_gic.c, best_irq = 15). However, it will never call the PendSV Handler (xPortPendSVHandler here). This function is recorded in the nvic vector.
Next, (after the svc), the processor will execute the line after in code (this is a naked function) so the next function written after vPortStartFirstTask in the code.


command line :
console 1 : qemu-system-arm -M lm3s6965evb -kernel gcc/RTOSDemo.axf -s -S
console 2 : arm-none-eabi-gdb -ex "target remote localhost:1234" gcc/RTOSDemo.axf

arm-none-eabi from http://www.codesourcery.com/sgpp/lite/arm/portal/release1294
Same error with another project with arm-elf

processor : arm cortex m3

host : gentoo (2.6.35-r9) (without kqemu)

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

end of thread, other threads:[~2018-01-06  4:31 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-08 18:00 [Qemu-devel] [Bug 657006] [NEW] arm - svc instruction jb
2010-10-08 19:48 ` [Qemu-devel] [Bug 657006] " jb
2011-03-07  9:43 ` [Qemu-devel] [Bug 657006] Re: arm v7M - svc insn doesn't trigger PendSV handler Peter Maydell
2011-03-07 19:25 ` jb
2012-03-01 15:00 ` Oleksiy Bondarenko
2012-03-01 15:19 ` Peter Maydell
2012-03-01 15:52 ` Oleksiy Bondarenko
2012-03-01 16:27 ` Peter Maydell
2012-03-01 18:32 ` Oleksiy Bondarenko
2012-08-20 16:43 ` Mark Phillips
2012-08-20 20:34   ` Peter Maydell
2012-08-22  9:26 ` Mark Phillips
2012-08-22  9:30 ` Mark Phillips
2012-08-22  9:45 ` Peter Maydell
2012-08-22 12:14 ` Mark Phillips
2012-08-22 14:37 ` Mark Phillips
2012-08-22 16:47 ` Mark Phillips
2017-10-26 13:13 ` Thomas Huth
2017-11-06 11:39 ` Peter Maydell
2018-01-06  4:17 ` Launchpad Bug Tracker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.