Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2779 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
29 | #include <arch/asm/regname.h> |
- | |
30 | #include <arch/context_offset.h> |
29 | #include <arch/context_offset.h> |
31 | 30 | ||
32 | .text |
31 | .text |
33 | 32 | ||
34 | .set noat |
33 | .set noat |
Line 36... | Line 35... | ||
36 | .set nomacro |
35 | .set nomacro |
37 | 36 | ||
38 | .global context_save_arch |
37 | .global context_save_arch |
39 | .global context_restore_arch |
38 | .global context_restore_arch |
40 | 39 | ||
41 | .macro CONTEXT_STORE r |
- | |
42 | sw $s0,OFFSET_S0(\r) |
- | |
43 | sw $s1,OFFSET_S1(\r) |
- | |
44 | sw $s2,OFFSET_S2(\r) |
- | |
45 | sw $s3,OFFSET_S3(\r) |
- | |
46 | sw $s4,OFFSET_S4(\r) |
- | |
47 | sw $s5,OFFSET_S5(\r) |
- | |
48 | sw $s6,OFFSET_S6(\r) |
- | |
49 | sw $s7,OFFSET_S7(\r) |
- | |
50 | sw $s8,OFFSET_S8(\r) |
- | |
51 | sw $gp,OFFSET_GP(\r) |
- | |
52 | - | ||
53 | sw $ra,OFFSET_PC(\r) |
- | |
54 | sw $sp,OFFSET_SP(\r) |
- | |
55 | .endm |
- | |
56 | - | ||
57 | .macro CONTEXT_LOAD r |
- | |
58 | lw $s0,OFFSET_S0(\r) |
- | |
59 | lw $s1,OFFSET_S1(\r) |
- | |
60 | lw $s2,OFFSET_S2(\r) |
- | |
61 | lw $s3,OFFSET_S3(\r) |
- | |
62 | lw $s4,OFFSET_S4(\r) |
- | |
63 | lw $s5,OFFSET_S5(\r) |
- | |
64 | lw $s6,OFFSET_S6(\r) |
- | |
65 | lw $s7,OFFSET_S7(\r) |
- | |
66 | lw $s8,OFFSET_S8(\r) |
- | |
67 | lw $gp,OFFSET_GP(\r) |
- | |
68 | - | ||
69 | lw $ra,OFFSET_PC(\r) |
- | |
70 | lw $sp,OFFSET_SP(\r) |
- | |
71 | .endm |
- | |
72 | - | ||
73 | 40 | ||
74 | context_save_arch: |
41 | context_save_arch: |
75 | CONTEXT_STORE $a0 |
42 | CONTEXT_SAVE_ARCH_CORE $a0 |
76 | 43 | ||
77 | # context_save returns 1 |
44 | # context_save returns 1 |
78 | j $31 |
45 | j $31 |
79 | li $2, 1 |
46 | li $2, 1 |
80 | 47 | ||
81 | context_restore_arch: |
48 | context_restore_arch: |
82 | CONTEXT_LOAD $a0 |
49 | CONTEXT_RESTORE_ARCH_CORE $a0 |
83 | 50 | ||
84 | # context_restore returns 0 |
51 | # context_restore returns 0 |
85 | j $31 |
52 | j $31 |
86 | xor $2, $2 |
53 | xor $2, $2 |