[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH ARM v6 09/14] mini-os: arm: scheduling



On Wed, 2014-07-16 at 12:07 +0100, Thomas Leonard wrote:
> Based on an initial patch by Karim Raslan.
> 
> Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@xxxxxxxxx>
> Signed-off-by: Thomas Leonard <talex5@xxxxxxxxx>
> ---
>  extras/mini-os/arch/arm/arm32.S | 22 ++++++++++++++++++++++
>  extras/mini-os/arch/arm/sched.c | 38 ++++++++++++++++++++++++++++++++++++++
>  2 files changed, 60 insertions(+)
>  create mode 100644 extras/mini-os/arch/arm/sched.c
> 
> diff --git a/extras/mini-os/arch/arm/arm32.S b/extras/mini-os/arch/arm/arm32.S
> index 88efe24..56429b1 100644
> --- a/extras/mini-os/arch/arm/arm32.S
> +++ b/extras/mini-os/arch/arm/arm32.S
> @@ -204,8 +204,30 @@ irq_handler:
>  IRQ_handler:
>       .long   0x0
>  
> +
> +.globl __arch_switch_threads
> +@ => r0 = &prev->sp
> +@    r1 = &next->sp
> +@ <= returns to next thread's saved return address
> +__arch_switch_threads:
> +     stmia   r0, {sp, lr}    @ Store current sp and ip to prev's struct 
> thread
> +     str     fp, [sp, #-4]   @ Store fp on the old stack
> +
> +     ldmia   r1, {sp, lr}    @ Load new sp, ip from next's struct thread
> +     ldr     fp, [sp, #-4]   @ Restore fp from the stack
> +
> +     mov     pc, lr

I'm a bit confused by the lack of saving of the GPRs here. Shouldn't at
least the caller saved registers (r4..r11) be saved/restored here?

> +void run_idle_thread(void)
> +{
> +    __asm__ __volatile__ ("mov sp, %0; mov pc, %1"::"r"(idle_thread->sp), 
> "r"(idle_thread->ip));

Is bx preferred to mov pc these days? I don't know if it matters in this
case...


> +    /* Never arrive here! */
> +}



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.