Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: tests/syscall_return_sandboxing/sandboxed_mips.S

Issue 12667019: [MIPS] Support for building tests for MIPS (Closed) Base URL: http://git.chromium.org/native_client/src/native_client.git@master
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2013 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 /*
8 * Assume 32-byte trampoline slots, 16-byte bundles.
9 */
10 #define GETTIMEOFDAY_ADDR 0x10500
11 #define STORE_MASK $t7
12 #define JUMP_MASK $t6
13
14 .data
15 timebuf:
16 .space 0x200 /* enough for a timeval */
17 .text
18 .globl SyscallReturnIsSandboxed
19 SyscallReturnIsSandboxed:
20 .set noreorder
21
22 addiu $sp, $sp, -24
23 and $sp, $sp, STORE_MASK
24 sw $ra, 20($sp)
25 lui $a0, %hi(timebuf)
26
27 addiu $a0, $a0, %lo(timebuf)
28 addu $a1, $zero, $zero
29 lui $ra, %hi(bad)
30 addiu $ra, $ra, %lo(bad)
31
32 lui $a2, %hi(GETTIMEOFDAY_ADDR)
33 addiu $a2, $a2, %lo(GETTIMEOFDAY_ADDR)
34 and $a2, $a2, JUMP_MASK
35 jr $a2
36
37 nop /* sandboxed (bundle aligned) return address */
Mark Seaborn 2013/03/12 00:39:29 This would be more robust as: .p2align 4 /* Exp
38 xor $v0, $v0, 1 /* expected return value */
39 bad: lw $ra, 20($sp) /* non-sandboxed return address */
40 nop
41
42 addiu $sp, $sp, 24
43 and $sp, $sp, STORE_MASK
44 and $ra, $ra, JUMP_MASK
45 jr $ra
46
47 nop
48
OLDNEW
« no previous file with comments | « tests/syscall_return_sandboxing/nacl.scons ('k') | tests/thread_capture/arch/mips/thread_capture_test_injection.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698