OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Native Client Authors. All rights reserved. | 2 * Copyright 2012 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
| 7 #include "native_client/src/trusted/service_runtime/arch/mips/sel_ldr_mips.h" |
7 #include "native_client/src/trusted/service_runtime/include/bits/nacl_syscalls.h
" | 8 #include "native_client/src/trusted/service_runtime/include/bits/nacl_syscalls.h
" |
8 #include "native_client/src/trusted/service_runtime/nacl_config.h" | 9 #include "native_client/src/trusted/service_runtime/nacl_config.h" |
9 | 10 |
10 #define STORE_MASK $t7 | 11 #define STORE_MASK $t7 |
11 #define JUMP_MASK $t6 | 12 #define JUMP_MASK $t6 |
12 #define NACL_HALT 0x00000008 /*opcode for "jr $zero", Mips nacl halt*/ | |
13 | 13 |
14 /* | 14 /* |
15 * Code to test various address layout boundary conditions. | 15 * Code to test various address layout boundary conditions. |
16 * This is a translation from the x86-{32,64} code, and is | 16 * This is a translation from the x86-{32,64} code, and is |
17 * not intended to be super efficent, just good enough to | 17 * not intended to be super efficent, just good enough to |
18 * print out the values that are designed, while maintaining | 18 * print out the values that are designed, while maintaining |
19 * strict control over the address space layout. | 19 * strict control over the address space layout. |
20 */ | 20 */ |
21 | 21 |
22 .text | 22 .text |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 addiu $t9, $t9, %lo(NACL_SYSCALL_ADDR(NACL_sys_exit)) | 227 addiu $t9, $t9, %lo(NACL_SYSCALL_ADDR(NACL_sys_exit)) |
228 addu $a0, $zero, $s0 | 228 addu $a0, $zero, $s0 |
229 nop | 229 nop |
230 | 230 |
231 nop | 231 nop |
232 and $t9, $t9, JUMP_MASK | 232 and $t9, $t9, JUMP_MASK |
233 jalr $t9 | 233 jalr $t9 |
234 nop | 234 nop |
235 | 235 |
236 #if defined(PNACL_AS) | 236 #if defined(PNACL_AS) |
237 /* NOTE: unlike x86 the alignment directive on Mips takes | 237 /* |
238 the logarithm of the alignment */ | 238 * NOTE: unlike x86 the alignment directive on MIPS takes |
| 239 * the logarithm of the alignment |
| 240 */ |
239 #define POW2_BIGGER_THAN_DOT 14 | 241 #define POW2_BIGGER_THAN_DOT 14 |
240 .align32 POW2_BIGGER_THAN_DOT, NACL_HALT | 242 .align32 POW2_BIGGER_THAN_DOT, NACL_HALT_OPCODE |
241 .fill (TEXT_EXTEND - (1 << POW2_BIGGER_THAN_DOT))/4, 4, NACL_HALT | 243 .fill (TEXT_EXTEND - (1 << POW2_BIGGER_THAN_DOT))/4, 4, NACL_HALT_OPCODE |
242 #else | 244 #else |
243 .fill (TEXT_EXTEND - (. - start_of_text))/4, 4, NACL_HALT | 245 .fill (TEXT_EXTEND - (. - start_of_text))/4, 4, NACL_HALT_OPCODE |
244 #endif | 246 #endif |
245 | 247 |
246 end_of_text: | 248 end_of_text: |
247 | 249 |
248 #if defined(EXPECTED_RODATA) | 250 #if defined(EXPECTED_RODATA) |
249 .section .rodata | 251 .section .rodata |
250 ro_str: .ascii "Hello world\n" | 252 ro_str: .ascii "Hello world\n" |
251 #endif | 253 #endif |
252 | 254 |
OLD | NEW |