OpenCores
URL https://opencores.org/ocsvn/or1k_soc_on_altera_embedded_dev_kit/or1k_soc_on_altera_embedded_dev_kit/trunk

Subversion Repositories or1k_soc_on_altera_embedded_dev_kit

[/] [or1k_soc_on_altera_embedded_dev_kit/] [trunk/] [linux-2.6/] [linux-2.6.24/] [arch/] [avr32/] [kernel/] [switch_to.S] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 xianfeng
/*
2
 * Copyright (C) 2004-2006 Atmel Corporation
3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License version 2 as
6
 * published by the Free Software Foundation.
7
 */
8
 
9
#include 
10
 
11
        .text
12
        .global __switch_to
13
        .type   __switch_to, @function
14
 
15
        /* Switch thread context from "prev" to "next", returning "last"
16
         *   r12 :      prev
17
         *   r11 :      &prev->thread + 1
18
         *   r10 :      &next->thread
19
         */
20
__switch_to:
21
        stm     --r11, r0,r1,r2,r3,r4,r5,r6,r7,sp,lr
22
        mfsr    r9, SYSREG_SR
23
        st.w    --r11, r9
24
        ld.w    r8, r10++
25
        /*
26
         * schedule() may have been called from a mode with a different
27
         * set of registers. Make sure we don't lose anything here.
28
         */
29
        pushm   r10,r12
30
        mtsr    SYSREG_SR, r8
31
        frs                     /* flush the return stack */
32
        sub     pc, -2          /* flush the pipeline */
33
        popm    r10,r12
34
        ldm     r10++, r0,r1,r2,r3,r4,r5,r6,r7,sp,pc
35
        .size   __switch_to, . - __switch_to

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.