OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 #include "nacl_mips_defs.h" |
| 8 |
| 9 .text |
| 10 .p2align 4 |
| 11 .align NACL_BLOCK_SHIFT |
| 12 .globl setjmp |
| 13 .ent setjmp |
| 14 .frame $sp, 0, $31 |
| 15 .set noreorder |
| 16 |
| 17 /* int setjmp(jmp_buf env) */ |
| 18 setjmp: |
| 19 |
| 20 /* The code here is grouped by instruction bundle. */ |
| 21 |
| 22 /* NACL_CALLEE_SAVE_LIST BEGIN */ |
| 23 and $a0, $a0, STORE_MASK |
| 24 sw $s0, 0($a0) |
| 25 and $a0, $a0, STORE_MASK |
| 26 sw $s1, 4($a0) |
| 27 |
| 28 and $a0, $a0, STORE_MASK |
| 29 sw $s2, 8($a0) |
| 30 and $a0, $a0, STORE_MASK |
| 31 sw $s3, 12($a0) |
| 32 |
| 33 and $a0, $a0, STORE_MASK |
| 34 sw $s4, 16($a0) |
| 35 and $a0, $a0, STORE_MASK |
| 36 sw $s5, 20($a0) |
| 37 |
| 38 and $a0, $a0, STORE_MASK |
| 39 sw $s6, 24($a0) |
| 40 and $a0, $a0, STORE_MASK |
| 41 sw $s7, 28($a0) |
| 42 |
| 43 and $a0, $a0, STORE_MASK |
| 44 sw $sp, 32($a0) |
| 45 and $a0, $a0, STORE_MASK |
| 46 sw $fp, 36($a0) |
| 47 |
| 48 and $a0, $a0, STORE_MASK |
| 49 sw $ra, 40($a0) |
| 50 and $a0, $a0, STORE_MASK |
| 51 swc1 $f20, 44($a0) |
| 52 |
| 53 and $a0, $a0, STORE_MASK |
| 54 swc1 $f21, 48($a0) |
| 55 and $a0, $a0, STORE_MASK |
| 56 swc1 $f22, 52($a0) |
| 57 |
| 58 and $a0, $a0, STORE_MASK |
| 59 swc1 $f23, 56($a0) |
| 60 and $a0, $a0, STORE_MASK |
| 61 swc1 $f24, 60($a0) |
| 62 |
| 63 and $a0, $a0, STORE_MASK |
| 64 swc1 $f25, 64($a0) |
| 65 and $a0, $a0, STORE_MASK |
| 66 swc1 $f26, 68($a0) |
| 67 |
| 68 and $a0, $a0, STORE_MASK |
| 69 swc1 $f27, 72($a0) |
| 70 and $a0, $a0, STORE_MASK |
| 71 swc1 $f28, 76($a0) |
| 72 |
| 73 and $a0, $a0, STORE_MASK |
| 74 swc1 $f29, 80($a0) |
| 75 and $a0, $a0, STORE_MASK |
| 76 swc1 $f30, 84($a0) |
| 77 |
| 78 and $a0, $a0, STORE_MASK |
| 79 swc1 $f31, 88($a0) |
| 80 /* NACL_CALLEE_SAVE_LIST END */ |
| 81 move $v0, $zero |
| 82 nop |
| 83 |
| 84 and $ra, $ra, JUMP_MASK |
| 85 j $ra |
| 86 nop |
| 87 nop |
| 88 |
| 89 .end setjmp |
| 90 |
| 91 .text |
| 92 .p2align 4 |
| 93 .align NACL_BLOCK_SHIFT |
| 94 .globl longjmp |
| 95 .ent longjmp |
| 96 .set noreorder |
| 97 |
| 98 /* void longjmp(jmp_buf env, int val) */ |
| 99 longjmp: |
| 100 |
| 101 /* NACL_CALLEE_LOAD_LIST BEGIN */ |
| 102 and $a0, $a0, STORE_MASK |
| 103 lw $s0, 0($a0) |
| 104 and $a0, $a0, STORE_MASK |
| 105 lw $s1, 4($a0) |
| 106 |
| 107 and $a0, $a0, STORE_MASK |
| 108 lw $s2, 8($a0) |
| 109 and $a0, $a0, STORE_MASK |
| 110 lw $s3, 12($a0) |
| 111 |
| 112 and $a0, $a0, STORE_MASK |
| 113 lw $s4, 16($a0) |
| 114 and $a0, $a0, STORE_MASK |
| 115 lw $s5, 20($a0) |
| 116 |
| 117 and $a0, $a0, STORE_MASK |
| 118 lw $s6, 24($a0) |
| 119 and $a0, $a0, STORE_MASK |
| 120 lw $s7, 28($a0) |
| 121 |
| 122 and $a0, $a0, STORE_MASK |
| 123 lw $sp, 32($a0) |
| 124 and $sp, $sp, STORE_MASK |
| 125 nop |
| 126 |
| 127 and $a0, $a0, STORE_MASK |
| 128 lw $fp, 36($a0) |
| 129 and $a0, $a0, STORE_MASK |
| 130 lw $ra, 40($a0) |
| 131 |
| 132 and $a0, $a0, STORE_MASK |
| 133 lwc1 $f20, 44($a0) |
| 134 and $a0, $a0, STORE_MASK |
| 135 lwc1 $f21, 48($a0) |
| 136 |
| 137 and $a0, $a0, STORE_MASK |
| 138 lwc1 $f22, 52($a0) |
| 139 and $a0, $a0, STORE_MASK |
| 140 lwc1 $f23, 56($a0) |
| 141 |
| 142 and $a0, $a0, STORE_MASK |
| 143 lwc1 $f24, 60($a0) |
| 144 and $a0, $a0, STORE_MASK |
| 145 lwc1 $f25, 64($a0) |
| 146 |
| 147 and $a0, $a0, STORE_MASK |
| 148 lwc1 $f26, 68($a0) |
| 149 and $a0, $a0, STORE_MASK |
| 150 lwc1 $f27, 72($a0) |
| 151 |
| 152 and $a0, $a0, STORE_MASK |
| 153 lwc1 $f28, 76($a0) |
| 154 and $a0, $a0, STORE_MASK |
| 155 lwc1 $f29, 80($a0) |
| 156 |
| 157 and $a0, $a0, STORE_MASK |
| 158 lwc1 $f30, 84($a0) |
| 159 and $a0, $a0, STORE_MASK |
| 160 lwc1 $f31, 88($a0) |
| 161 /* NACL_CALLEE_LOAD_LIST END */ |
| 162 |
| 163 bne $a1, $zero, 1f |
| 164 nop |
| 165 ori $a1, $zero, 1 |
| 166 1: |
| 167 move $v0, $a1 |
| 168 |
| 169 and $ra, $ra, JUMP_MASK |
| 170 j $ra |
| 171 nop |
| 172 nop |
| 173 |
| 174 .end longjmp |
| 175 |
OLD | NEW |